-
Notifications
You must be signed in to change notification settings - Fork 930
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
Support save WithCTE for insertRepartitionBeforeWrite #6783
base: master
Are you sure you want to change the base?
Conversation
…e Exists Before Sort Node
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6783 +/- ##
========================================
Coverage 0.00% 0.00%
========================================
Files 687 688 +1
Lines 42439 44124 +1685
Branches 5793 6123 +330
========================================
- Misses 42439 44124 +1685 ☔ View full report in Codecov by Sentry. |
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 if tests pass
There is an issue with the logic of check write in base unit test. Please wait #6793 |
Thanks for the PR! This PR is being closed due to inactivity. This isn't a judgement on the merit of the PR in any way. If this is still an issue with the latest version of Kyuubi, please reopen it and ask a committer to remove the Stale tag! Thank you for using Kyuubi! |
🔍 Description
Issue References 🔗
First, I'd like to thank @wForget for the help with this issue.
When using the "save to HDFS" feature, queries ending with an
ORDER BY
sometimes lose their sort order in the results. Upon investigating the code, I discovered that when usingWITH
statements and saving SQL results withtoDF.write.save
, aWithCTE
node is generated after the Sort node. This causes thecanInsertRepartitionByExpression
check to fail, leading to an incorrectRepartition
node insertion after the Sort node, which ultimately disrupts the sort order.However, this issue does not occur when using
INSERT INTO TABLE
withWithCTE
nodes.The provided unit test can reproduce this issue, but after using
toDF.write.save
, I am unable to access the complete execution plan to assert whether aRepartition
node is present. Therefore, the current test is ineffective.Hope someone can help figure out how to write this unit test.
Describe Your Solution 🔧
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Types of changes 🔖
Test Plan 🧪
Behavior Without This Pull Request ⚰️
Behavior With This Pull Request 🎉
Related Unit Tests
Checklist 📝
Be nice. Be informative.