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

Automatic varchar widening #11

Open
awm33 opened this issue Feb 9, 2019 · 1 comment
Open

Automatic varchar widening #11

awm33 opened this issue Feb 9, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@awm33
Copy link
Member

awm33 commented Feb 9, 2019

For a better user experience, and efficient handling of text data, target-redshift should implement automatic varchar widening, which starts off at a default (say 255) and automatically widen the varchar max length column as it observes field text lengths in incoming batches.

Steps:

  1. Start with a default max length for each new varchar column.
  2. On each new batch, for each table:
    a) Get the current length of each varchar column in the target table.
    b) At some point before updating the schema, find the max of the length of all the record values for every varchar column.
    c) If it’s past the limit (64k), warn or throw an Exception.
    d) If it's under the limit (64k), update the column max length during schema update.
@awm33 awm33 added the enhancement New feature or request label Feb 9, 2019
@gbachRM
Copy link

gbachRM commented Jun 7, 2021

Agreed! Please implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants