jayzhan211 commented on code in PR #26768:
URL: https://github.com/apache/datafusion/pull/26768#discussion_r4412255752
##########
benchmarks/src/sql_benchmark_runner.rs:
##########
@@ -825,6 +825,38 @@ mod tests {
}
}
+ #[tokio::test]
+ async fn tpch_init_preserves_session_settings() {
+ use crate::sql_benchmark::QueryDirective;
+ use datafusion::prelude::SessionConfig;
+
+ let mut config = SessionConfig::new();
+ config.options_mut().optimizer.prefer_hash_join = false;
+ config.options_mut().execution.hash_join_buffering_capacity = 4096;
+ let ctx = SessionContext::new_with_config(config);
+ let directory = default_sql_benchmark_directory();
+ let benchmark = SqlBenchmark::new(
+ &ctx,
+ directory.join("tpch/benchmarks/q01.benchmark"),
Review Comment:
@mattsu2020 thanks for cleaning up the benchmark settings! Optional: this
only checks `q01.benchmark`, so an `init` re-added to any of the other TPC-H
files would slip through (I tried it with q07). Looping over the directory
covers all 22:
```rs
// Exercise the suite's real init SQL without loading the TPC-H dataset.
for entry in fs::read_dir(directory.join("tpch/benchmarks")).unwrap() {
let benchmark = SqlBenchmark::new(&ctx, entry.unwrap().path(),
&directory)
.await
.unwrap();
if let Some(queries) = benchmark.queries().get(&QueryDirective::Init) {
for query in queries {
ctx.sql(query).await.unwrap().collect().await.unwrap();
}
}
}
```
--
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]