Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement unparse OuterReferenceColumn to String #10544

Merged
merged 1 commit into from
May 16, 2024

Conversation

goldmedal
Copy link
Contributor

@goldmedal goldmedal commented May 16, 2024

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.

Ok((qualifier, field)) => {
// found an exact match on a qualified name in the outer plan schema, so this is an outer reference column
Ok(Expr::OuterReferenceColumn(
field.data_type().clone(),
Column::from((qualifier, field)),
))

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

@github-actions github-actions bot added the sql SQL Planner label May 16, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- thanks @goldmedal

This PR needs to be merged up from main to resolve a conflict if/when you have time

@goldmedal goldmedal force-pushed the feature/10523-outer-column-reference branch from 1551cb7 to baeb3f6 Compare May 16, 2024 12:21
@alamb
Copy link
Contributor

alamb commented May 16, 2024

Thanks again @goldmedal

@alamb alamb merged commit 842f393 into apache:main May 16, 2024
23 checks passed
@goldmedal
Copy link
Contributor Author

Thanks @alamb !

@goldmedal goldmedal deleted the feature/10523-outer-column-reference branch May 16, 2024 13:24
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OuterColumnReference Expr --> String Support
2 participants