houqp commented on a change in pull request #754:
URL: https://github.com/apache/arrow-datafusion/pull/754#discussion_r672482751



##########
File path: datafusion/tests/parquet_pruning.rs
##########
@@ -136,6 +136,47 @@ async fn prune_date64() {
     assert_eq!(output.result_rows, 1, "{}", output.description());
 }
 
+#[tokio::test]
+async fn prune_disabled() {
+    let query = "SELECT * FROM t where nanos < to_timestamp('2020-01-02 
01:01:11Z')";
+    let expected_rows = 10;
+
+    // with pruning
+    let output = ContextWithParquet::new(Scenario::Timestamps)
+        .await
+        .query(query)
+        .await;
+
+    // This should prune one without error
+    assert_eq!(output.predicate_evaluation_errors(), Some(0));
+    assert_eq!(output.row_groups_pruned(), Some(1));
+    assert_eq!(
+        output.result_rows,
+        expected_rows,
+        "{}",
+        output.description()
+    );
+
+    // same query, without pruning
+    let config = ExecutionConfig::new().with_parquet_pruning(false);
+
+    let output = ContextWithParquet::with_config(Scenario::Timestamps, config)
+        .await
+        .query(query)
+        .await;
+    println!("{}", output.description());

Review comment:
       is this print needed for the test?

##########
File path: datafusion/tests/parquet_pruning.rs
##########
@@ -136,6 +136,47 @@ async fn prune_date64() {
     assert_eq!(output.result_rows, 1, "{}", output.description());
 }
 
+#[tokio::test]
+async fn prune_disabled() {
+    let query = "SELECT * FROM t where nanos < to_timestamp('2020-01-02 
01:01:11Z')";
+    let expected_rows = 10;
+
+    // with pruning
+    let output = ContextWithParquet::new(Scenario::Timestamps)
+        .await
+        .query(query)
+        .await;
+
+    // This should prune one without error
+    assert_eq!(output.predicate_evaluation_errors(), Some(0));
+    assert_eq!(output.row_groups_pruned(), Some(1));
+    assert_eq!(
+        output.result_rows,
+        expected_rows,
+        "{}",
+        output.description()
+    );
+
+    // same query, without pruning
+    let config = ExecutionConfig::new().with_parquet_pruning(false);
+
+    let output = ContextWithParquet::with_config(Scenario::Timestamps, config)
+        .await
+        .query(query)
+        .await;
+    println!("{}", output.description());

Review comment:
       cool, just wanted to make sure it's intentional :)




-- 
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]


Reply via email to