You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2022/02/10 18:21:53 UTC
[arrow-datafusion] branch master updated: Improve tpch benchmark errors (#1800)
This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/master by this push:
new 52f9dff Improve tpch benchmark errors (#1800)
52f9dff is described below
commit 52f9dff440fc5af0a3dacd3fe4a5168f1a89e597
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Thu Feb 10 13:19:04 2022 -0500
Improve tpch benchmark errors (#1800)
---
benchmarks/src/bin/tpch.rs | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/benchmarks/src/bin/tpch.rs b/benchmarks/src/bin/tpch.rs
index 93c44ef..1cc6687 100644
--- a/benchmarks/src/bin/tpch.rs
+++ b/benchmarks/src/bin/tpch.rs
@@ -562,8 +562,21 @@ async fn register_tables(path: &str, file_format: &str, ctx: &BallistaContext) {
fn get_query_sql(query: usize) -> Result<String> {
if query > 0 && query < 23 {
- let filename = format!("queries/q{}.sql", query);
- Ok(fs::read_to_string(&filename).expect("failed to read query"))
+ let possibilities = vec![
+ format!("queries/q{}.sql", query),
+ format!("benchmarks/queries/q{}.sql", query),
+ ];
+ let mut errors = vec![];
+ for filename in possibilities {
+ match fs::read_to_string(&filename) {
+ Ok(contents) => return Ok(contents),
+ Err(e) => errors.push(format!("{}: {}", filename, e)),
+ };
+ }
+ Err(DataFusionError::Plan(format!(
+ "invalid query. Could not find query: {:?}",
+ errors
+ )))
} else {
Err(DataFusionError::Plan(
"invalid query. Expected value between 1 and 22".to_owned(),