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

on_schema_change not working in iceberg incremental models #445

Open
e-quili opened this issue Sep 23, 2024 · 0 comments
Open

on_schema_change not working in iceberg incremental models #445

e-quili opened this issue Sep 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@e-quili
Copy link

e-quili commented Sep 23, 2024

Describe the bug

The parameter on_schema_change, which configures behavior when the schema changes in an incremental model, seems to be ignored with iceberg tables.

Current behavior

When we add the column "new_col" to an existing incremental model configured as below, the new column is not added to the materialized table.

{{ 
    config(
        materialized='incremental',
        incremental_strategy='merge',
        unique_key='table_id',
        on_schema_change='append_new_columns',
        file_format= 'iceberg'
    )
}} 

SELECT  
        CAST(table_id AS string) AS table_id 
       ,CAST(value AS float) AS value
       ,CAST(1 AS int) AS new_col   -- new column added afterwards
FROM 
       glue_catalog.{{ ref('test_table') }} 

Expected behavior

With the setting on_schema_change='append_new_columns', "new_col" should be added to the materialized table.

Screenshots and log output

  • incremental_strategy='merge' : we don't get any error message
  • incremental_strategy='append' : we get the error message "too many data columns"

System information

The output of dbt --version:

Core:
  - installed: 1.8.6
  - latest:    1.8.6 - Up to date!

Plugins:
  - glue:   1.8.1 - Up to date!
  - spark:  1.8.0 - Up to date!

The operating system you're using:
Windows

The output of python --version:
Python 3.12.6

@e-quili e-quili added the bug Something isn't working label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant