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

[LCA]: Ability replace Lateral Alias with actual column name and Expression #1222

Open
1 task done
sundarshankar89 opened this issue Nov 19, 2024 · 4 comments · May be fixed by #1242
Open
1 task done

[LCA]: Ability replace Lateral Alias with actual column name and Expression #1222

sundarshankar89 opened this issue Nov 19, 2024 · 4 comments · May be fixed by #1242
Assignees
Labels
enhancement New feature or request

Comments

@sundarshankar89
Copy link
Contributor

sundarshankar89 commented Nov 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Category of feature request

Transpile

Problem statement

Given the following Snowflake SQL:

SELECT column_a as customer_id
FROM mytable
WHERE customer_id = '123'

The following Spark SQL should be returned because of the different alias scoping used in Spark SQL

SELECT column_a as customer_id
FROM mytable
WHERE column_a = '123'

https://www.databricks.com/blog/introducing-support-lateral-column-alias

Proposed Solution

NA

Additional Context

No response

@sundarshankar89 sundarshankar89 added the enhancement New feature or request label Nov 19, 2024
@sundarshankar89
Copy link
Contributor Author

sundarshankar89 commented Nov 19, 2024

@ericvergnaud this might be an issue you can tackle.

@sundarshankar89
Copy link
Contributor Author

more such examples are present under lca_utils.py on how we tackle we haven't covered all combinations but you can refer how we do preprocessing using python prototype.

@ericvergnaud
Copy link
Contributor

@sundarshankar89 re the output, did you mean:

SELECT column_a as customer_id
FROM mytable
WHERE column_a = '123'

?

@sundarshankar89
Copy link
Contributor Author

Just edited the description.

Also checkout test_lca_utils.py it has few more examples with LCA in sourcesystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants