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

[BUG]: Dealiasing for SnowFlake may introduce precedence issues #1286

Open
1 task done
ericvergnaud opened this issue Dec 5, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@ericvergnaud
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Category of Bug / Issue

TranspileLateralColumnAliasError

Current Behavior

Consider the following:

SELECT 
   a - b as c1,
   c * c1 as c2
FROM t
WHERE c2 > 0

This currently transpiles to:

SELECT 
   a - b as c1,
   c * c1 as c2
FROM t
WHERE c * a - b > 0

which probably behaves differently from expected

See #1242

Expected Behavior

A possible solution could be to transpile to:

SELECT 
   a - b as c1,
   c * c1 as c2
FROM t
WHERE c * (a - b) > 0

Steps To Reproduce

No response

Relevant log output or Exception details

No response

Sample Query

No response

Operating System

macOS

Version

latest via Databricks CLI

@ericvergnaud ericvergnaud added the bug Something isn't working label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant