Skip to content

Conversation

@sfc-gh-dflippo
Copy link
Collaborator

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

@sfc-gh-dflippo sfc-gh-dflippo requested a review from Copilot July 2, 2025 19:29
@sfc-gh-dflippo sfc-gh-dflippo self-assigned this Jul 2, 2025
@sfc-gh-dflippo sfc-gh-dflippo linked an issue Jul 2, 2025 that may be closed by this pull request
@sfc-gh-dflippo sfc-gh-dflippo merged commit 7bf9091 into main Jul 2, 2025
1 check passed
Copy link

Copilot AI left a 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 ICEBERG prefix for Snowflake DDL when is_iceberg_format is true and refine constraint lookup/caching.
  • Switch all var(...) calls to string‐based truth checks, add dbt_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_norely flag 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" %}

Comment on lines +24 to +32
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"
Copy link

Copilot AI Jul 2, 2025

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'.

Suggested change
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"

Copilot uses AI. Check for mistakes.
{%- for row in results.rows -%}
{%- do upper_column_list.append(row["column_name"]|upper) -%}
{%- if row['null?'] == 'false' -%}
{%- if row['null?'] == true -%}
Copy link

Copilot AI Jul 2, 2025

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.

Suggested change
{%- if row['null?'] == true -%}
{%- if row['null?'] == 'true' -%}

Copilot uses AI. Check for mistakes.
{%- 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" ) -%}
Copy link

Copilot AI Jul 2, 2025

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.

Suggested change
{%- set modify_statements = modify_statements.append( "COLUMN " ~ column ~ " SET NOT NULL" ) -%}
{%- do modify_statements.append( "COLUMN " ~ column ~ " SET NOT NULL" ) -%}

Copilot uses AI. Check for mistakes.
@sfc-gh-dflippo sfc-gh-dflippo deleted the 84-iceberg-format-support-using-snowflake branch July 2, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Iceberg format support using Snowflake

2 participants