apache / datafusion

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

Implement unparse `OuterReferenceColumn` to String #10544

Closed goldmedal closed 2 weeks ago

goldmedal commented 2 weeks ago

Which issue does this PR close?

Closes #10523

Rationale for this change

IMO, OuterReferenceColumn is a column can be resolved to an outside field of the current plan. Typically, it's produced from identifier or compound_identifier. https://github.com/apache/datafusion/blob/7535d93fa631f0fc42ca1521bc257ca20480b246/datafusion/sql/src/expr/identifier.rs#L64-L69

I think we can just convert it to a column sql node. Just like other identifier. Because the concept of outer reference is a logical plan concept, we can ignore the type of a OuterReferenceColumn which produced by a field resolving.

What changes are included in this PR?

Convert OuterReferenceColumn to a Column SQL node.

Are these changes tested?

Yes

Are there any user-facing changes?

No

alamb commented 2 weeks ago

Thanks again @goldmedal

goldmedal commented 2 weeks ago

Thanks @alamb !