Skip to content

Commit 1c7b746

Browse files
committed
more
Signed-off-by: Andrew Duffy <[email protected]>
1 parent 1831786 commit 1c7b746

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

vortex-layout/src/layouts/struct_/reader.rs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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\tvalidity: {}\n\t\tdtype: {}\n\t\texpr: {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

Comments
 (0)