You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/30 11:42:37 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #2986: minor: collation the prune test

alamb commented on code in PR #2986:
URL: https://github.com/apache/arrow-datafusion/pull/2986#discussion_r933795667


##########
datafusion/core/tests/parquet_pruning.rs:
##########
@@ -184,301 +188,203 @@ async fn prune_disabled() {
 
 #[tokio::test]
 async fn prune_int32_lt() {
-    let (expected_errors, expected_row_group_pruned, expected_results) =
-        (Some(0), Some(1), 11);
-
+    test_prune(
+        Scenario::Int32,
+        "SELECT * FROM t where i < 1",
+        Some(0),
+        Some(1),
+        11,
+    )
+    .await;
     // result of sql "SELECT * FROM t where i < 1" is same as
     // "SELECT * FROM t where -i > -1"
-    let output = ContextWithParquet::new(Scenario::Int32)
-        .await
-        .query("SELECT * FROM t where i < 1")
-        .await;
-
-    println!("{}", output.description());
-    // This should prune out groups without error
-    assert_eq!(output.predicate_evaluation_errors(), expected_errors);
-    assert_eq!(output.row_groups_pruned(), expected_row_group_pruned);
-    assert_eq!(
-        output.result_rows,
-        expected_results,
-        "{}",
-        output.description()
-    );
-
-    let output = ContextWithParquet::new(Scenario::Int32)
-        .await
-        .query("SELECT * FROM t where -i > -1")
-        .await;
-
-    println!("{}", output.description());
-    // This should prune out groups without error
-    assert_eq!(output.predicate_evaluation_errors(), expected_errors);
-    assert_eq!(output.row_groups_pruned(), expected_row_group_pruned);
-    assert_eq!(
-        output.result_rows,
-        expected_results,
-        "{}",
-        output.description()
-    );
+    test_prune(
+        Scenario::Int32,
+        "SELECT * FROM t where -i > -1",
+        Some(0),
+        Some(1),
+        11,
+    )
+    .await;
 }
 
 #[tokio::test]
 async fn prune_int32_eq() {
-    // result of sql "SELECT * FROM t where i = 1"
-    let output = ContextWithParquet::new(Scenario::Int32)
-        .await
-        .query("SELECT * FROM t where i = 1")
-        .await;
-
-    println!("{}", output.description());
-    // This should prune out groups without error
-    assert_eq!(output.predicate_evaluation_errors(), Some(0));
-    assert_eq!(output.row_groups_pruned(), Some(3));
-    assert_eq!(output.result_rows, 1, "{}", output.description());
+    test_prune(
+        Scenario::Int32,
+        "SELECT * FROM t where i = 1",
+        Some(0),
+        Some(3),
+        1,
+    )
+    .await;
 }
-
 #[tokio::test]
 async fn prune_int32_scalar_fun_and_eq() {
-    // result of sql "SELECT * FROM t where abs(i) = 1 and i = 1"
-    // only use "i = 1" to prune
-    let output = ContextWithParquet::new(Scenario::Int32)
-        .await
-        .query("SELECT * FROM t where abs(i) = 1  and i = 1")
-        .await;
-
-    println!("{}", output.description());
-    // This should prune out groups without error
-    assert_eq!(output.predicate_evaluation_errors(), Some(0));
-    assert_eq!(output.row_groups_pruned(), Some(3));
-    assert_eq!(output.result_rows, 1, "{}", output.description());
+    test_prune(

Review Comment:
   ```suggestion
       // result of sql "SELECT * FROM t where abs(i) = 1 and i = 1"
       // only use "i = 1" to prune
       test_prune(
   ```



##########
datafusion/core/tests/parquet_pruning.rs:
##########
@@ -129,7 +141,7 @@ async fn prune_date64() {
         .await
         .query_with_expr(col("date64").lt(lit(date)))
         // .query(
-        //     "SELECT * FROM t where date64 < caste('2020-01-02' as date)",
+        //     "SELECT * FROM t where date64 < cast('2020-01-02' as date)",

Review Comment:
   👍 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org