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

Trouble with virtual generated columns #338

Open
SpencerMalone opened this issue Dec 2, 2022 · 6 comments
Open

Trouble with virtual generated columns #338

SpencerMalone opened this issue Dec 2, 2022 · 6 comments

Comments

@SpencerMalone
Copy link

👋 We have a virtual generated column, but it seems like ghostferry is trying to insert data into the virtual generated column when it should not, resulting in an error like...

during prepare query near paginationKey <redacted>: Error 3105: The value specified for generated column '<redacted>' in table '<redacted>' is not allowed.

Seems like we should just not insert any data into virtual generated columns

@shuhaowu
Copy link
Contributor

shuhaowu commented Dec 2, 2022

You might be able to ignore the column in this function by removing the virtual columns from TableSchema.Table.Columns:

for _, tableSchema := range tableSchemas {

@SpencerMalone
Copy link
Author

That's a good thought, lemme pull on that thread locally and check back in!

@SpencerMalone
Copy link
Author

Sorry, I'm still struggling with this a bit, but hopefully will have an update in a few weeks!

@SpencerMalone
Copy link
Author

Ignoring in the table schema ended up being a bit of a dead end, it made the DML stuff pretty unhappy, in the end we settled with maintaining a ColumnsToSkip list in type TableSchema struct, and using that to rebuild ColumnsToSelect in the cursor, and simply skipping the rows in the DML events. Would y'all be interested in a PR?

@milanatshopify
Copy link
Contributor

Would y'all be interested in a PR?

Always interested in PRs - did you have some work in progress?

@SpencerMalone
Copy link
Author

I can try to untangle our change to get it into the upstream, we've had it in production for ~a year now, but our fork is so divergent it may not happen at this point D:

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

3 participants