-
Notifications
You must be signed in to change notification settings - Fork 562
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
Allow to reuse batch if append failed #1223
Comments
Hi @JILeXanDR This is the current behavior of batch insertion. On the very first error for data append, the connection is released, and all next append calls will return the previous error. This error is intentionally wrapped with Line 46 in 51cea28
I agree it might be counter-intuitive, but also, I don't see a good solution here. There might be client-side data validation, where we can recover (like in this case), however we cannot recover for errors sent from ClickHouse. |
But any error from Append is local rather than from Clickhouse right? |
@yujiarista @JILeXanDR |
@yujiarista @JILeXanDR I had a look on this today and found a discussion (I forgot about it 🤦 ) we already had in the past on this: #655 tl;dr given columnar append, it's not trivial to guarantee reusable batch without data corruption. I still agree it needs to be enhanced, but not sooner than in v3. |
Describe the bug
Steps to reproduce
Expected behaviour
Currently it's not possible to understand what row is corrupted, even if 1 row of 10000 will have some invalid value, it affects all next data in the current batch.
There are 2 possible ways to give some flexibility:
when
AppendStruct
detects any problem with current struct data it returns an error and doesn't append corrupted values to batch, developer must decide what to do with that error on his own, but it should be possible to continue and skip that rowswhen
AppendStruct
detects any problem with current struct data it returns an error, appends row like now, but any next calls ofAppendStruct
with valid data will be succeedCode example
Error log
Configuration
Environment
ClickHouse server
CREATE TABLE
statements for tables involved:The text was updated successfully, but these errors were encountered: