-
Notifications
You must be signed in to change notification settings - Fork 17
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
Redshift Loader: migrate column if enum field's max length changes #1158
Comments
I have same issue, after update an schema to insert a new enum value if the size of this new value is higher than older ones redshift varchar is not resized and value is truncated. Is there any solution for this ? |
There looks to be some fun history here! Support for this seems originally added in snowplow/schema-ddl#83, but then disabled in snowplow/schema-ddl#121 because it broke snowplow/schema-ddl#36 which also lead to snowplow/schema-ddl#110. So These days Redshift has I think these days we're better off just encoding as ZSTD from the get-go, ignoring Text255 for enums, and re-enabling maxLength support for enum columns. But I think for rdb-loader to be able to automatically handle the migration properly schema-ddl would need specific support added for updating ENCODE which I'm not sure is a small amount of work. It would be nice though if rdb-loader/schema-ddl gave a warning or something if it skipped a resize due to the column encoding, though. |
If we have a schema with a property that is an enum, eg:
currently the column will not be created as
VARCHAR(256)
but with the size of the longest possible enum value, ieVARCHAR(3)
.If a new, longer value is added to the enum, the column will not be migrated to a new size. Instead, any input values will be truncated so they can be loaded.
The loader should probably:
maxLength
setting if there is one;maxLength
, keep track of whether the max possible value of the enum has changed and migrate the column.The text was updated successfully, but these errors were encountered: