apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
5.21k stars 957 forks source link

Minor: Do not force analyzer to copy logical plans #10367

Closed alamb closed 2 weeks ago

alamb commented 2 weeks ago

(this has 4 lines of code change and the rest are test updates to remove &)

Which issue does this PR close?

Part of https://github.com/apache/datafusion/issues/9637

Rationale for this change

The current Analyzer::execute_and_check API requires cloning a LogicalPlan

What changes are included in this PR?

  1. Change Analyzer::execute_and_check to take an owned plan (and thus the caller to do the clone if they don't have one)

Are these changes tested?

CI

Note I expect this to have a limited impact on performance as the higher level APIs (e.g. SessionState::optimize still take a &LogicalPlan) but at least the lower level APIs wont

Are there any user-facing changes?