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/11/01 16:31:38 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #4047: Add CI checks that we can serde all benchmark queries

andygrove commented on code in PR #4047:
URL: https://github.com/apache/arrow-datafusion/pull/4047#discussion_r1010640172


##########
benchmarks/src/bin/tpch.rs:
##########
@@ -618,291 +630,412 @@ mod tests {
         Ok(str)
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q1() -> Result<()> {
-        verify_query(1).await
+    async fn run_q1() -> Result<()> {
+        run_query(1).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q2() -> Result<()> {
-        verify_query(2).await
+    async fn run_q2() -> Result<()> {
+        run_query(2).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q3() -> Result<()> {
-        verify_query(3).await
+    async fn run_q3() -> Result<()> {
+        run_query(3).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q4() -> Result<()> {
-        verify_query(4).await
+    async fn run_q4() -> Result<()> {
+        run_query(4).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q5() -> Result<()> {
-        verify_query(5).await
+    async fn run_q5() -> Result<()> {
+        run_query(5).await
     }
 
-    #[cfg(feature = "ci")]
-    #[ignore] // https://github.com/apache/arrow-datafusion/issues/4024
     #[tokio::test]
-    async fn verify_q6() -> Result<()> {
-        verify_query(6).await
+    async fn run_q6() -> Result<()> {
+        run_query(6).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q7() -> Result<()> {
-        verify_query(7).await
+    async fn run_q7() -> Result<()> {
+        run_query(7).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q8() -> Result<()> {
-        verify_query(8).await
+    async fn run_q8() -> Result<()> {
+        run_query(8).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q9() -> Result<()> {
-        verify_query(9).await
+    async fn run_q9() -> Result<()> {
+        run_query(9).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q10() -> Result<()> {
-        verify_query(10).await
+    async fn run_q10() -> Result<()> {
+        run_query(10).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q11() -> Result<()> {
-        verify_query(11).await
+    async fn run_q11() -> Result<()> {
+        run_query(11).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q12() -> Result<()> {
-        verify_query(12).await
+    async fn run_q12() -> Result<()> {
+        run_query(12).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q13() -> Result<()> {
-        verify_query(13).await
+    async fn run_q13() -> Result<()> {
+        run_query(13).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q14() -> Result<()> {
-        verify_query(14).await
+    async fn run_q14() -> Result<()> {
+        run_query(14).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q15() -> Result<()> {
-        verify_query(15).await
+    async fn run_q15() -> Result<()> {
+        run_query(15).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q16() -> Result<()> {
-        verify_query(16).await
+    async fn run_q16() -> Result<()> {
+        run_query(16).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q17() -> Result<()> {
-        verify_query(17).await
+    async fn run_q17() -> Result<()> {
+        run_query(17).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q18() -> Result<()> {
-        verify_query(18).await
+    async fn run_q18() -> Result<()> {
+        run_query(18).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q19() -> Result<()> {
-        verify_query(19).await
+    async fn run_q19() -> Result<()> {
+        run_query(19).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q20() -> Result<()> {
-        verify_query(20).await
+    async fn run_q20() -> Result<()> {
+        run_query(20).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q21() -> Result<()> {
-        verify_query(21).await
+    async fn run_q21() -> Result<()> {
+        run_query(21).await
     }
 
-    #[cfg(feature = "ci")]
     #[tokio::test]
-    async fn verify_q22() -> Result<()> {
-        verify_query(22).await
+    async fn run_q22() -> Result<()> {
+        run_query(22).await
+    }
+
+    async fn run_query(n: usize) -> Result<()> {
+        // Tests running query with empty tables, to see whether they run successfully.
+
+        let config = SessionConfig::new()
+            .with_target_partitions(1)
+            .with_batch_size(10);
+        let ctx = SessionContext::with_config(config);
+
+        for &table in TPCH_TABLES {
+            let schema = get_tpch_table_schema(table);
+            let batch = RecordBatch::new_empty(Arc::new(schema.to_owned()));
+
+            ctx.register_batch(table, batch)?;
+        }
+
+        let sql = &get_query_sql(n)?;
+        for query in sql {
+            execute_query(&ctx, query, false).await?;
+        }
+
+        Ok(())
+    }
+}
+
+/// CI checks
+#[cfg(test)]
+#[cfg(feature = "ci")]

Review Comment:
   These tests rely on the data files existing in a path from `TPCH_DATA` env var, which is set in CI



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