-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix precedence of CTEs with respect to set operations in SnowFlake #1273
base: main
Are you sure you want to change the base?
Conversation
Looks like some of the functional tests have cosmetic differences with the Python versions, specifically extra parentheses when transpiling set operations. I'll move the affected tests into the core-specific test set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but some functional tests that are failing on python-sqlglot should be moved to core_engine
| a * t.d | ||
|FROM t;""".stripMargin transpilesTo | ||
"Common Table Expressions (CTEs)" should { | ||
"""support expressions""" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would "have precedence" be better ?
Not sure we want to drop the python tests altogether, notably n the light of the Multiplexer MVP scope ? |
Move those tests under |
-- databricks sql: | ||
WITH a AS (SELECT 1, 2, 3) | ||
|
||
(SELECT 4, 5, 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the parenthesis are required here
WITH a AS (SELECT 1, 2, 3), | ||
b AS (SELECT 4, 5, 6), | ||
c AS (SELECT * FROM a) | ||
(SELECT * from b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the parenthesis are required here
-- databricks sql: | ||
WITH a AS (SELECT 1, 2, 3) | ||
|
||
(SELECT 4, 5, 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the parenthesis are required here
WITH a AS (SELECT 1, 2, 3), | ||
b AS (SELECT 4, 5, 6), | ||
c AS (SELECT * FROM a) | ||
(SELECT * from b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the parenthesis are required here
…ine. The python implementation fails due to some cosmetic differences in the output.
This PR fixes the handling of CTEs with respect to set operations; prior to this the CTE was associated with only the first
SELECT
in the sequence of set operations instead of the entire set.Incidental changes:
Resolves: #1267