[DO NOT MERGE (yet)] Avoid Iceberg CTAS for table materialization#725
Draft
dataders wants to merge 1 commit into
Draft
[DO NOT MERGE (yet)] Avoid Iceberg CTAS for table materialization#725dataders wants to merge 1 commit into
dataders wants to merge 1 commit into
Conversation
This was referenced Apr 24, 2026
|
@dataders sources:
- name: streams
database: sq
schema: streams
tables:
- name: google_114Where sq - attached iceberg warehouse with rest catalog -- model: stg_google with data from
{{ config(materialized='table') }}
select * from {{ source('streams', 'google_114')}}
-- command: dbt run -s stg_google
-- sql in logs:
create table
"sq"."analytics"."stg_google__dbt_tmp"
as (
select * from "sq"."streams"."google_114";
alter table "sq"."analytics"."stg_google__dbt_tmp" rename to "stg_google"here is PR for alter table .. rename to.. Should i just rewrite materialization? |
2 tasks
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.
Warning
this is hopefully a soon to be obviated workaround.
the ideal fix is upstream in the duckdb-iceberg extension itself: duckdb/duckdb-iceberg#962
What changed
type: iceberg.CREATE TABLE ASfor table materializations.CREATE TABLE (...)followed byINSERT INTO ... SELECTfor Iceberg targets.Why
DuckDB Iceberg REST can execute CTAS during prepare through ADBC/dbt-fusion, then fail during execute because the table already exists. This mirrors the Fusion fix in https://github.com/dbt-labs/fs/pull/9658 and tracks dbt-labs/dbt-core#14547.
Verification
Draft PR for early review and adapter-maintainer heads-up.