Skip to content

Commit 6202254

Browse files
committed
Avoid double optimizing in tpchds_planning tests
1 parent a899ca0 commit 6202254

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

datafusion/core/tests/tpcds_planning.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,10 +1051,13 @@ async fn regression_test(query_no: u8, create_physical: bool) -> Result<()> {
10511051

10521052
for sql in &sql {
10531053
let df = ctx.sql(sql).await?;
1054-
let (state, plan) = df.into_parts();
1055-
let plan = state.optimize(&plan)?;
1056-
if create_physical {
1057-
let _ = state.create_physical_plan(&plan).await?;
1054+
// attempt to mimic planning steps
1055+
if !create_physical {
1056+
let (state, plan) = df.into_parts();
1057+
let _ = state.optimize(&plan)?;
1058+
} else {
1059+
// this is what df.execute() does internally
1060+
let _ = df.create_physical_plan().await?;
10581061
}
10591062
}
10601063

0 commit comments

Comments
 (0)