-
Notifications
You must be signed in to change notification settings - Fork 35
84 iceberg format support using snowflake #97
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
84 iceberg format support using snowflake #97
Conversation
…g RELY for join elimination
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.
Pull Request Overview
Adds broad support for Snowflake Iceberg tables, enhances global configuration options, fixes quoting and mixed‐case handling, and bumps version to 1.0.5.
- Trim quotes from generated constraint names across all adapters.
- Introduce
ICEBERGprefix for Snowflake DDL whenis_iceberg_formatis true and refine constraint lookup/caching. - Switch all
var(...)calls to string‐based truth checks, adddbt_constraints_always_norely, and update integration tests and documentation.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| macros/*__create_constraints.sql (all adapters) | Added ` |
| macros/snowflake__create_constraints.sql | Added ICEBERG DDL prefix, improved cache updates, semi-structured detection |
| macros/create_constraints.sql | Changed var checks to string matching, added new global vars |
| integration_tests/models/schema.yml | New not_null tests for array/object/variant columns |
| integration_tests/models/dim_part.sql | Inject semi-structured columns for Snowflake and TitleCasePartKey |
| integration_tests/macros/clone_table.sql | Conditional macro guard and log verbosity updates |
| integration_tests/dbt_project.yml | Added global constraint flags including dbt_constraints_always_norely |
| dbt_project.yml | Bumped version to 1.0.5, added new global vars |
| README.md | Documented dbt_constraints_always_norely |
Comments suppressed due to low confidence (1)
macros/create_constraints.sql:275
- The new
dbt_constraints_always_norelyflag logic isn’t covered by integration tests. Consider adding a test case to verify that RELY is skipped when this variable is true.
{%- set dbt_constraints_always_norely = var('dbt_constraints_always_norely', "false")|string|lower == "true" %}
| description: "Test that we don't create not null contraints on array columns" | ||
| tests: | ||
| - not_null | ||
| - name: test_object_col | ||
| description: "Test that we don't create not null contraints on object columns" | ||
| tests: | ||
| - not_null | ||
| - name: test_variant_col | ||
| description: "Test that we don't create not null contraints on variant columns" |
Copilot
AI
Jul 2, 2025
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.
Typo in description: 'contraints' should be 'constraints'.
| description: "Test that we don't create not null contraints on array columns" | |
| tests: | |
| - not_null | |
| - name: test_object_col | |
| description: "Test that we don't create not null contraints on object columns" | |
| tests: | |
| - not_null | |
| - name: test_variant_col | |
| description: "Test that we don't create not null contraints on variant columns" | |
| description: "Test that we don't create not null constraints on array columns" | |
| tests: | |
| - not_null | |
| - name: test_object_col | |
| description: "Test that we don't create not null constraints on object columns" | |
| tests: | |
| - not_null | |
| - name: test_variant_col | |
| description: "Test that we don't create not null constraints on variant columns" |
| {%- for row in results.rows -%} | ||
| {%- do upper_column_list.append(row["column_name"]|upper) -%} | ||
| {%- if row['null?'] == 'false' -%} | ||
| {%- if row['null?'] == true -%} |
Copilot
AI
Jul 2, 2025
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.
Comparing row['null?'] to boolean true may fail if run_query returns the string 'true'/'false'. Consider normalizing to string comparison or casting.
| {%- if row['null?'] == true -%} | |
| {%- if row['null?'] == 'true' -%} |
| {%- set ddl_prefix_for_alter = 'ICEBERG' if table_relation.is_iceberg_format else '' -%} | ||
| {%- set modify_statements= [] -%} | ||
| {%- for column in columns_list -%} | ||
| {%- set modify_statements = modify_statements.append( "COLUMN " ~ column ~ " SET NOT NULL" ) -%} |
Copilot
AI
Jul 2, 2025
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.
In Jinja, append mutates the list and returns None. Assigning its return will break modify_statements. Instead, call modify_statements.append(...) without reassigning.
| {%- set modify_statements = modify_statements.append( "COLUMN " ~ column ~ " SET NOT NULL" ) -%} | |
| {%- do modify_statements.append( "COLUMN " ~ column ~ " SET NOT NULL" ) -%} |
Adds support for Snowflake Iceberg tables
Adds dbt_constraints_always_noreply variable to globally disable using RELY for join elimination
Updates the version in the dbt_project.yml to 1.0.5
Misc integration test changes for recent minor enhancements
Fixes support for mixed case columns on all DB by selectively trimming
Adds support for text and boolean values for all variables
Fixes metadata caching for Snowflake