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

ignore some columns on copy_rows #28

Open
csonuryilmaz opened this issue Jan 10, 2022 · 1 comment
Open

ignore some columns on copy_rows #28

csonuryilmaz opened this issue Jan 10, 2022 · 1 comment

Comments

@csonuryilmaz
Copy link

Hi, is there a way to disable some table columns from config.json on copy_rows step?

MySQL has generated columns feature. See docs here.

So we can't insert or update value for generated columns since values of a generated column are computed from an expression included in the column definition.

We need to ignore those columns on copy_rows step. They will be filled by database automatically.

🤔 Tool may detect those columns automatically and ignore them from select/insert process, if MySQL has some metadata to identify generated columns at information_schema.columns.

💡 But manually entering those kinds of table columns from config.json should be enough for most cases. Also it wil give more flexibility for some future problematic columns.


Note: I've read about a possible workaround at issue #17 and evaluate this comment for my case. But it's not a solution for generated columns.

These columns also don't accept null values. An example error message from MySQL:

... The value specified for generated column 'anniversary_date' in table 'customer' is not allowed.

@Travmatth
Copy link

Hi Onur, sorry for the delayed response. Unfortunately in looking through our codebase I don't see a way to operate over generated columns currently, for the reasons you raise. As you allude to, we'd need to exclude such columns entirely inside copy_rows. While I'd welcome a PR to address this, sadly it's not something we can prioritize currently.

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

No branches or pull requests

2 participants