-
Notifications
You must be signed in to change notification settings - Fork 30
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
With Recursive #1000
Merged
Merged
With Recursive #1000
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
738daed
Init Commit for With Recursive
sundarshankar89 6eb0e36
Merge branch 'main' into chore/fix_with_recursive
sundarshankar89 8e93009
Merge branch 'main' into chore/fix_with_recursive
sundarshankar89 dc92e04
Merge branch 'main' into chore/fix_with_recursive
sundarshankar89 bc0b694
Grammar Changes
sundarshankar89 0f77b0b
Grammar Changes
sundarshankar89 1d00a10
visitor changes
sundarshankar89 1663e45
Fixed Test cases
sundarshankar89 43969db
Merge branch 'main' into chore/fix_with_recursive
sundarshankar89 6c19775
merged main branch
sundarshankar89 ab8d161
merged main branch
sundarshankar89 e3f49b8
Merge branch 'main' into chore/fix_with_recursive
sundarshankar89 1644849
intermediate commit
sundarshankar89 670ae11
Added Test Case
sundarshankar89 24566a4
Merge branch 'main' into chore/fix_with_recursive
sundarshankar89 5d12e0b
Merge branch 'main' into chore/fix_with_recursive
sundarshankar89 1599dfa
Merge branch 'main' into chore/fix_with_recursive
sundarshankar89 2d1d9f5
Merge branch 'main' into chore/fix_with_recursive
sundarshankar89 56d9178
Fixed review comments
sundarshankar89 0302438
Fixed review comments
sundarshankar89 ce94cd4
Added TODO
sundarshankar89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tests/resources/functional/snowflake/core_engine/test_cte/cte_simple.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- snowflake sql: | ||
WITH employee_hierarchy AS ( | ||
SELECT | ||
employee_id, | ||
manager_id, | ||
employee_name | ||
FROM | ||
employees | ||
WHERE | ||
manager_id IS NULL | ||
) | ||
SELECT * | ||
FROM employee_hierarchy; | ||
|
||
-- databricks sql: | ||
WITH employee_hierarchy AS (SELECT employee_id, manager_id, employee_name FROM employees WHERE manager_id IS NULL) SELECT * FROM employee_hierarchy; |
52 changes: 52 additions & 0 deletions
52
tests/resources/functional/snowflake/core_engine/test_cte/recursive_cte.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
-- snowflake sql: | ||
WITH RECURSIVE employee_hierarchy AS ( | ||
SELECT | ||
employee_id, | ||
manager_id, | ||
employee_name, | ||
1 AS level | ||
FROM | ||
employees | ||
WHERE | ||
manager_id IS NULL | ||
UNION ALL | ||
SELECT | ||
e.employee_id, | ||
e.manager_id, | ||
e.employee_name, | ||
eh.level + 1 AS level | ||
FROM | ||
employees e | ||
INNER JOIN | ||
employee_hierarchy eh ON e.manager_id = eh.employee_id | ||
) | ||
SELECT * | ||
FROM employee_hierarchy | ||
ORDER BY level, employee_id; | ||
|
||
-- databricks sql: | ||
/* The following issues were detected: | ||
|
||
*** WITH RECURSIVE IS NOT SUPPORTED *** | ||
WITH RECURSIVE employee_hierarchy AS ( | ||
SELECT | ||
employee_id, | ||
manager_id, | ||
employee_name, | ||
1 AS level | ||
FROM | ||
employees | ||
WHERE | ||
manager_id IS NULL | ||
UNION ALL | ||
SELECT | ||
e.employee_id, | ||
e.manager_id, | ||
e.employee_name, | ||
eh.level + 1 AS level | ||
FROM | ||
employees e | ||
INNER JOIN | ||
employee_hierarchy eh ON e.manager_id = eh.employee_id | ||
) | ||
*/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
there are reports that
WITH RECURSIVE
could be implemented with various slow-performance hacks in PySpark - see https://stackoverflow.com/questions/52562607/recursive-cte-in-spark-sqlgiven that, we should emit new
WithRecursive
node and try to translate it in PySpark laterThere 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.
Sure
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.
Ready for review