You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are loading a sql_table resource to Snowflake, and beteen two runs a column in the source has been expanded from varchar(11) to ..(35). The Snowflake schema is not updated, and the load fails due to too large values.
Expected behavior
The schemas for the relevant tables in Snowflake (staging, landing) are evolved to match the increased max length of the source data fields.
Steps to reproduce
Difficult to provide an exact recipe to reproduce, but it would be something akin to the following:
Load a sql_table (e.g. select '123'::varchar(3) as v from a Snowflake source) to a Snowflake destination
With the merge strategy, run the load again but with an expanded field (e.g. select '12345'::varchar(5) as v)
Expect to see an error like: snowflake.connector.errors.ProgrammingError: 100074 (54000): User character length limit (3) exceeded by string '12345'
Operating system
Linux
Runtime environment
Kubernetes
Python version
3.11
dlt data source
sql_database / sql_table (imported via dlt template)
dlt destination
Snowflake
Other deployment details
No response
Additional information
The schema in the _dlt_version meta table seems to be updated, but not the actual tables themselves
The text was updated successfully, but these errors were encountered:
@marius-sb1dlt is not altering existing tables. this allows us to make sure all migrations are backward compatible and will not conflict with each other when done in parallel. this outweights the cost of altering existing schemas.
so you need to alter the table manually (not sure if that is possible on Snowflake?)
to prevent that in the future: do not use full_with_precision reflection level. use the standard one (full) which will create varchars (and other types) with maximum precision
@marius-sb1dlt is not altering existing tables. this allows us to make sure all migrations are backward compatible and will not conflict with each other when done in parallel. this outweights the cost of altering existing schemas.
Thanks for the quick reply @rudolfix, but hmm - not sure I fully understand.. What is schema evolution with dlt then? Is it only adding new (or renamed columns as new) columns, plus new columns for new datatypes - or are those not supported with Snowflake either?
dlt version
dlt 0.5.4
Describe the problem
We are loading a sql_table resource to Snowflake, and beteen two runs a column in the source has been expanded from varchar(11) to ..(35). The Snowflake schema is not updated, and the load fails due to too large values.
Expected behavior
The schemas for the relevant tables in Snowflake (staging, landing) are evolved to match the increased max length of the source data fields.
Steps to reproduce
Difficult to provide an exact recipe to reproduce, but it would be something akin to the following:
select '123'::varchar(3) as v
from a Snowflake source) to a Snowflake destinationselect '12345'::varchar(5) as v
)snowflake.connector.errors.ProgrammingError: 100074 (54000): User character length limit (3) exceeded by string '12345'
Operating system
Linux
Runtime environment
Kubernetes
Python version
3.11
dlt data source
sql_database / sql_table (imported via dlt template)
dlt destination
Snowflake
Other deployment details
No response
Additional information
The text was updated successfully, but these errors were encountered: