Skip to content
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

[Bug] Setting a comment does not work with Iceberg tables #770

Open
2 tasks done
dlouseiro opened this issue Jan 28, 2025 · 0 comments · May be fixed by dbt-labs/dbt-snowflake#1299
Open
2 tasks done

[Bug] Setting a comment does not work with Iceberg tables #770

dlouseiro opened this issue Jan 28, 2025 · 0 comments · May be fixed by dbt-labs/dbt-snowflake#1299
Labels
feature:iceberg Issues related to Iceberg support pkg:dbt-snowflake Issue affects dbt-snowflake

Comments

@dlouseiro
Copy link

Is this a new bug in dbt-snowflake?

  • I believe this is a new bug in dbt-snowflake
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

In its current implementation, when I try to set a comment on an Iceberg table, dbt-snowflake tries to do run the following command:

comment on table some_database.some_schema.some_table IS $$some comment$$

This command fails for Iceberg tables, with the following error:

SQL Compilation error: The table some_table is an Iceberg table. Iceberg tables should use ALTER ICEBERG TABLE commands. Please ensure the appropriate command format is used.

Expected Behavior

When a comment is set for an Iceberg table, the comment should be set using:

alter iceberg table some_database.some_schema.some_table set comment=$$some comment$$

I'd even go further and propose that the snowflake__alter_relation_comment macro should start using alter table, alter dynamic table, alter iceberg table to set comments as this approach is compatible with every type of object instead of creating yet another exception for Iceberg tables in the macro.

Steps To Reproduce

  1. Create a model foo with table_format: iceberg, ensuring the description is populated
  2. Run dbt using dbt run --select foo

Relevant log output

Environment

- OS: macOS 15.2
- Python: 3.11.11
- dbt-core: 1.9.1
- dbt-snowflake: 1.9.0

Additional Context

No response

@amychen1776 amychen1776 transferred this issue from dbt-labs/dbt-snowflake Feb 4, 2025
@amychen1776 amychen1776 added pkg:dbt-snowflake Issue affects dbt-snowflake feature:iceberg Issues related to Iceberg support labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:iceberg Issues related to Iceberg support pkg:dbt-snowflake Issue affects dbt-snowflake
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants