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

feat: lateral column alias reference (#507) #521

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

maoxingda
Copy link
Contributor

@maoxingda maoxingda commented Jan 1, 2024

Closes #507

Copy link

codecov bot commented Jan 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b620d78) 99.49% compared to head (3cf66c2) 99.49%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #521   +/-   ##
=======================================
  Coverage   99.49%   99.49%           
=======================================
  Files          41       41           
  Lines        2170     2185   +15     
=======================================
+ Hits         2159     2174   +15     
  Misses         11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@reata reata left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. The code looks good to me.

One question: can we extend the current logic to handle lateral column alias at top level (not in a subquery), or do you plan to handle that in separate PR?

insert into public.tgt_tbl1
select
    name      as user_name,
    user_name as id -- backward reference
from
    public.src_tbl1
;

@maoxingda
Copy link
Contributor Author

maoxingda commented Jan 1, 2024

Thanks for response. I'm not sure if I can handle it, but I'll give it a try.

@reata
Copy link
Owner

reata commented Jan 1, 2024

We can also merge this and not closing #507, if top-level lateral column alias takes too much effort.

Just let me know your conclusion. Thanks for taking time investigating.

@maoxingda
Copy link
Contributor Author

If it can be like this, that would be the best.

@maoxingda
Copy link
Contributor Author

I will try to expand at top level.

@maoxingda maoxingda force-pushed the feat/lateral-column-alias-ref branch from f0efc8a to 3cf66c2 Compare January 1, 2024 07:59
@maoxingda
Copy link
Contributor Author

We can also merge this and not closing #507, if top-level lateral column alias takes too much effort.

Just let me know your conclusion. Thanks for taking time investigating.

It seems that it doesn't require too much effort.

@reata reata merged commit 4adcc8f into reata:master Jan 1, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Lateral Column Alias Reference Analyzing
2 participants