Skip to content

Commit 375c446

Browse files
authored
fix(sql): apply table-scan rewrite before EXPLAIN display (#161)
1 parent ada0e9a commit 375c446

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • datafusion-federation/src/sql

datafusion-federation/src/sql/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,12 @@ impl DisplayAs for VirtualExecutionPlan {
287287
if let Some(ctx) = self.executor.compute_context() {
288288
write!(f, " compute_context={ctx}")?;
289289
};
290-
let mut plan = self.plan.clone();
290+
let mut plan = match RewriteTableScanAnalyzer::rewrite(self.plan.clone()) {
291+
Ok(plan) => plan,
292+
Err(_) => self.plan.clone(),
293+
};
291294
if let Ok(statement) = self.plan_to_statement(&plan) {
292-
write!(f, " initial_sql={statement}")?;
295+
write!(f, " base_sql={statement}")?;
293296
}
294297

295298
let (logical_optimizers, ast_analyzers) = match gather_analyzers(&plan) {

0 commit comments

Comments
 (0)