Dandandan commented on code in PR #4280:
URL: https://github.com/apache/arrow-datafusion/pull/4280#discussion_r1026464405
##########
datafusion/core/src/physical_plan/file_format/parquet.rs:
##########
@@ -1554,6 +1567,37 @@ mod tests {
assert_contains!(&display, "projection=[c1]");
}
+ #[tokio::test]
+ async fn parquet_exec_skip_empty_pruning() {
+ let c1: ArrayRef = Arc::new(StringArray::from(vec![
+ Some("Foo"),
+ None,
+ Some("bar"),
+ Some("bar"),
+ Some("bar"),
+ Some("bar"),
+ Some("zzz"),
+ ]));
+
+ // batch1: c1(string)
+ let batch1 = create_batch(vec![("c1", c1.clone())]);
+
+ // filter is too complicated for pruning
+ let filter = when(col("c1").not_eq(lit("bar")), lit(true))
+ .otherwise(lit(false))
+ .unwrap();
+
+ let rt = round_trip(vec![batch1], None, None, Some(filter), true,
false).await;
+
+ // Should not contain a pruning predicate
+ let pruning_predicate = &rt.parquet_exec.pruning_predicate;
+ assert!(
+ pruning_predicate.is_none(),
+ "Still had pruning predicate: {:?}",
Review Comment:
```suggestion
"Still had pruning predicate: {:?}",
```
--
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]