@@ -45,6 +45,7 @@ use crate::aggregate_fn::EmptyOptions;
4545use crate :: array:: ArrayView ;
4646use crate :: arrays:: Constant ;
4747use crate :: arrays:: ConstantArray ;
48+ use crate :: arrays:: map:: MapArrayExt ;
4849use crate :: arrays:: varbinview:: BinaryView ;
4950use crate :: dtype:: DType ;
5051use crate :: dtype:: DecimalType ;
@@ -199,6 +200,9 @@ pub(crate) fn canonical_uncompressed_size_in_bytes(
199200 Canonical :: Decimal ( array) => decimal_uncompressed_size_in_bytes ( array, ctx) ,
200201 Canonical :: VarBinView ( array) => varbinview_uncompressed_size_in_bytes ( array, ctx) ,
201202 Canonical :: List ( array) => list_view_uncompressed_size_in_bytes ( array, ctx) ,
203+ Canonical :: Map ( array) => {
204+ list_view_uncompressed_size_in_bytes ( & array. entries ( ) . into_owned ( ) , ctx)
205+ }
202206 Canonical :: FixedSizeList ( array) => fixed_size_list_uncompressed_size_in_bytes ( array, ctx) ,
203207 Canonical :: Struct ( array) => struct_uncompressed_size_in_bytes ( array, ctx) ,
204208 Canonical :: Union ( array) => union_uncompressed_size_in_bytes ( array, ctx) ,
@@ -232,13 +236,14 @@ pub(crate) fn constant_uncompressed_size_in_bytes(
232236 array. len ( ) ,
233237 array. scalar ( ) . as_binary ( ) . value ( ) . map ( |value| value. len ( ) ) ,
234238 ) ?,
235- DType :: List ( ..) | DType :: FixedSizeList ( ..) | DType :: Struct ( ..) | DType :: Extension ( _) => {
239+ DType :: List ( ..)
240+ | DType :: Map ( ..)
241+ | DType :: FixedSizeList ( ..)
242+ | DType :: Struct ( ..)
243+ | DType :: Extension ( _) => {
236244 let canonical = array. array ( ) . clone ( ) . execute :: < Canonical > ( ctx) ?;
237245 return canonical_uncompressed_size_in_bytes ( & canonical, ctx) ;
238246 }
239- DType :: Map ( ..) => {
240- vortex_bail ! ( "UncompressedSizeInBytes is not supported for map arrays yet" )
241- }
242247 DType :: Union ( ..) => {
243248 todo ! (
244249 "TODO(connor)[Union]: support constant Union size accounting after constant Union \
@@ -297,7 +302,10 @@ fn supports_uncompressed_size_in_bytes(dtype: &DType) -> bool {
297302 DType :: List ( element_dtype, _) | DType :: FixedSizeList ( element_dtype, ..) => {
298303 supports_uncompressed_size_in_bytes ( element_dtype)
299304 }
300- DType :: Map ( ..) => false ,
305+ DType :: Map ( map_dtype, _) => {
306+ supports_uncompressed_size_in_bytes ( & map_dtype. key_dtype ( ) )
307+ && supports_uncompressed_size_in_bytes ( & map_dtype. value_dtype ( ) )
308+ }
301309 DType :: Struct ( fields, _) => fields
302310 . fields ( )
303311 . all ( |field| supports_uncompressed_size_in_bytes ( & field) ) ,
0 commit comments