-
Notifications
You must be signed in to change notification settings - Fork 351
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
Fixes in \copy implementation for Clickhouse #457
Conversation
The automated test could have been either in driver_test.go or in clickhouse_test.go . The copy test in driver_test.go |
if err != nil { | ||
return n, fmt.Errorf("failed to scan row: %w", err) | ||
} | ||
//We can't use values... in Exec() below, because, in some cases, clickhouse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something that others drivers would also benefit from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think both changes apply to the general drivers.CopyWithInsert implementation. More testing will be needed though since CopyWithInsert is used in 10 drivers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about doing this in three PRs
- This PR fixes Clickhouse only at first
- I do Batch insert in \copy to DB destination #458 for Clickhouse
- I integrate these fixes into drivers.CopyWithInsert + batching. To exercise the fixes, extend TestCopy drivers_test.go to include a source DB that doesn't support ScanType (e.g. csvq), and a target DB that only support prepared INSERT statements (e.g. Clickhouse, Databend).
Trying to go directly to step 3 will delay the fix for \copy for Clickhouse.
## What's Changed * Fix Clickhouse Test by @murfffi in xo/usql#455 * chore: fix function name in comment by @oftenoccur in xo/usql#456 * Fixes in \copy implementation for Clickhouse by @murfffi in xo/usql#457 ## New Contributors * @murfffi made their first contribution in xo/usql#455 * @oftenoccur made their first contribution in xo/usql#456 **Full Changelog**: xo/usql@v0.18.1...v0.19.0
## What's Changed * Fix Clickhouse Test by @murfffi in xo/usql#455 * chore: fix function name in comment by @oftenoccur in xo/usql#456 * Fixes in \copy implementation for Clickhouse by @murfffi in xo/usql#457 ## New Contributors * @murfffi made their first contribution in xo/usql#455 * @oftenoccur made their first contribution in xo/usql#456 **Full Changelog**: xo/usql@v0.18.1...v0.19.0
A couple of fixes in the Copy function for Clickhouse:
The new automated test fails without the fixes and succeeds with them.