[Bug] Plan IcebergCreateTable operator In CTAS queries to avoid double table create requests#974
Merged
Tmonster merged 10 commits intoMay 12, 2026
Conversation
…ll and also also responsible for updating Copy to file bind data
CTAS with partition information and table properties Co-authored-by: Anders <anders.swanson@dbtlabs.com>
…n so copy operator has partition information as well
Tishj
reviewed
May 8, 2026
Tishj
reviewed
May 8, 2026
Tishj
reviewed
May 8, 2026
Member
Author
|
Chatted with @lnkuiper , apparently GetGlobalOperatorState is also called only once per operator, so we can create the table when the global operator state is created |
Member
Author
|
ah just deploy left. Let's get this in |
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 supersedes #962
Resolves: #595
related: dbt-labs/dbt-core#14547
related: duckdb/dbt-duckdb#725
962 involves registering a client context on attach, but this will break down if many clients are involved since only one client will run the attach.
The solution in this PR is to introduce an intermediate
Create Iceberg Tableoperator between theCopy to FileandSelectthat is only responsible for creating the table on first chunk. This way the table is not created During Binding/Planning.This also fixes an issue where
EXPLAIN Create table as ..queries would actually create the table (assumingsupports_stage_create = false.