kosiew commented on code in PR #23391:
URL: https://github.com/apache/datafusion/pull/23391#discussion_r3548595384


##########
datafusion/datasource-parquet/src/row_filter.rs:
##########
@@ -2141,4 +2292,77 @@ mod test {
         let batch = RecordBatch::new_empty(Arc::clone(table_schema));
         expr.evaluate(&batch).is_ok()
     }
+
+    fn list_of(inner: DataType) -> DataType {
+        DataType::List(Arc::new(Field::new("element", inner, true)))
+    }
+
+    fn struct_of(fields: Vec<Field>) -> DataType {
+        DataType::Struct(fields.into_iter().map(Arc::new).collect::<Fields>())
+    }
+
+    #[test]

Review Comment:
   The added tests exercise `prune_and_collect` directly, which is helpful, but 
they do not cover the main behavior this PR changes: recognizing a real 
`CastExpr(Column, narrow_type)` projection and turning it into the correct read 
plan.
   
   A regression in `try_nested_projection_leaves` dispatch, 
`expr.data_type(file_schema)`, `ProjectionMask::leaves`, or `projected_schema` 
construction would not be caught by the current tests.
   
   Could you please add at least one integration-level regression test through 
`build_projection_read_plan` or `DecoderProjection::try_new` using the real 
`CastExpr(Column, narrow_type)` shape, and assert the leaf mask and projected 
schema for `array<struct<a,b>> -> array<struct<a>>`?
   
   Since the PR explicitly handles maps, it would also be good to include a 
narrowed map value struct case. Otherwise, we should probably defer map support 
if it is not intended to be covered here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to