@@ -271,6 +271,12 @@ impl LayoutReader for StructReader {
271271 . map ( |reader| reader. projection_evaluation ( row_range, & root ( ) , mask. clone ( ) ) )
272272 . transpose ( ) ?;
273273
274+ println ! (
275+ "StructReader::projection_eval on layout\n \t \t validity: {}\n \t \t dtype: {}\n \t \t expr: {expr}" ,
276+ validity_fut. is_some( ) ,
277+ self . dtype( ) ,
278+ ) ;
279+
274280 // Partition the expression into expressions that can be evaluated over individual fields
275281 let array_future = match & self . partition_expr ( expr. clone ( ) ) {
276282 Partitioned :: Single ( name, partition) => self
@@ -586,12 +592,22 @@ mod tests {
586592 get_item ( "b" , get_item ( "a" , root ( ) ) ) ,
587593 ) ;
588594
589- // Also make sure that nulls are handled appropriately.
590- // Also make sure the mask is pushed down and applied to the nested types.
591595 let project = reader
592596 . projection_evaluation ( & ( 0 ..3 ) , & expr, MaskFuture :: new_true ( 3 ) )
593597 . unwrap ( ) ;
594598
595- // evaluate the projection, yielding some buff
599+ let result = block_on ( move |_| project) . unwrap ( ) ;
600+ assert ! ( result. dtype( ) . is_struct( ) ) ;
601+
602+ // Struct scalars holding the "c" field value scalars
603+ assert_eq ! (
604+ result. scalar_at( 0 ) . as_struct( ) . field_by_idx( 0 ) . unwrap( ) ,
605+ Scalar :: primitive( 4 , Nullability :: Nullable )
606+ ) ;
607+ assert_eq ! ( result. scalar_at( 1 ) , Scalar :: null( result. dtype( ) . clone( ) ) ) ;
608+ assert_eq ! (
609+ result. scalar_at( 2 ) . as_struct( ) . field_by_idx( 0 ) . unwrap( ) ,
610+ Scalar :: primitive( 6 , Nullability :: Nullable )
611+ ) ;
596612 }
597613}
0 commit comments