CREATE and CTAS SORTED BY and PARTITIONED BY#1103
Draft
Alex-Monahan wants to merge 2 commits into
Draft
Conversation
Contributor
Author
|
This is the related DuckDB PR to unblock |
Contributor
Author
|
Happy to target 1.5 if it would be helpful! [Edit - I made another PR for that in case it is helpful - see below!] |
Contributor
Author
|
Marking this as draft - I think 1.5 is the better branch to target for now? (See #1107 ) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds support for the syntax from duckdb/duckdb#20431 and duckdb/duckdb#20728 :
plus the non CTAS
CREATE TABLEequivalent.One open issue is that the syntax added to DuckDB in the above PRs does not support adding sort modifiers (
ASC/DESC) to the sort, so I'll open up a bug for that here shortly if there isn't one already (added a FIXME in the code once that is unblocked).The key value of this PR is to make dbt work smoother with DuckLake. By default, everything in dbt is a CTAS. So this allows partitioning and sorting in a much smoother way in dbt (without a workaround).
This was built with Claude, but I did make a number of adjustments to its initial solution to try and refactor it (and I trimmed down the ridiculously long comments...). Let me know if there is anything you would like to see changed!
CC @nicku33