From 6860ae455c954a3d52b8ed5278e600507104878c Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Thu, 27 Oct 2022 10:32:21 -0600 Subject: [PATCH] Stop pretty printing in benchmark when there are no results (#3974) --- benchmarks/src/bin/tpch.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/benchmarks/src/bin/tpch.rs b/benchmarks/src/bin/tpch.rs index 7a914b19b9e1..02de551f2808 100644 --- a/benchmarks/src/bin/tpch.rs +++ b/benchmarks/src/bin/tpch.rs @@ -326,7 +326,11 @@ async fn execute_query( "=== Physical plan with metrics ===\n{}\n", DisplayableExecutionPlan::with_metrics(physical_plan.as_ref()).indent() ); - pretty::print_batches(&result)?; + if !result.is_empty() { + // do not call print_batches if there are no batches as the result is confusing + // and makes it look like there is a batch with no columns + pretty::print_batches(&result)?; + } } Ok(result) }