-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Dynamic Iceberg Table Required DDL Params (#1201)
* Fix base location not rendering without subpath and add tests. Take optional off params that are not optional in dynamic table create DDL. * Add changelog. * Revert changes to external volume * revert changes to catalog optionality. * Tabs. * Fix base_location_subpath generation for dynamic tables. --------- Co-authored-by: VersusFacit <[email protected]>
- Loading branch information
1 parent
d30670f
commit 7dea145
Showing
6 changed files
with
111 additions
and
64 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: Dynamic Iceberg table base_location_subpath generation fix. | ||
time: 2024-10-08T12:26:35.521308-07:00 | ||
custom: | ||
Author: versusfacit | ||
Issue: "1200" |
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
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,85 @@ | ||
_MODEL_BASIC_TABLE_MODEL = """ | ||
{{ | ||
config( | ||
materialized = "table", | ||
cluster_by=['id'], | ||
) | ||
}} | ||
select 1 as id | ||
""" | ||
|
||
_MODEL_BASIC_ICEBERG_MODEL = """ | ||
{{ | ||
config( | ||
transient = "true", | ||
materialized = "table", | ||
cluster_by=['id'], | ||
table_format="iceberg", | ||
external_volume="s3_iceberg_snow", | ||
base_location_subpath="subpath", | ||
) | ||
}} | ||
select * from {{ ref('first_table') }} | ||
""" | ||
|
||
_MODEL_BASIC_DYNAMIC_TABLE_MODEL = """ | ||
{{ config( | ||
materialized='dynamic_table', | ||
snowflake_warehouse='DBT_TESTING', | ||
target_lag='1 minute', | ||
refresh_mode='INCREMENTAL', | ||
table_format='iceberg', | ||
external_volume='s3_iceberg_snow', | ||
) }} | ||
select * from {{ ref('first_table') }} | ||
""" | ||
|
||
_MODEL_BASIC_DYNAMIC_TABLE_MODEL_WITH_SUBPATH = """ | ||
{{ config( | ||
materialized='dynamic_table', | ||
snowflake_warehouse='DBT_TESTING', | ||
target_lag='1 minute', | ||
refresh_mode='INCREMENTAL', | ||
table_format='iceberg', | ||
external_volume='s3_iceberg_snow', | ||
base_location_subpath='subpath', | ||
) }} | ||
select * from {{ ref('first_table') }} | ||
""" | ||
|
||
_MODEL_BUILT_ON_ICEBERG_TABLE = """ | ||
{{ | ||
config( | ||
materialized = "table", | ||
) | ||
}} | ||
select * from {{ ref('iceberg_table') }} | ||
""" | ||
|
||
_MODEL_TABLE_BEFORE_SWAP = """ | ||
{{ | ||
config( | ||
materialized = "table", | ||
) | ||
}} | ||
select 1 as id | ||
""" | ||
|
||
_MODEL_VIEW_BEFORE_SWAP = """ | ||
select 1 as id | ||
""" | ||
|
||
_MODEL_TABLE_FOR_SWAP_ICEBERG = """ | ||
{{ | ||
config( | ||
materialized = "table", | ||
table_format="iceberg", | ||
external_volume="s3_iceberg_snow", | ||
base_location_subpath="subpath", | ||
) | ||
}} | ||
select 1 as id | ||
""" |
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