-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(clickhouse sink)!: make skip_unknown_fields
optional
#22020
fix(clickhouse sink)!: make skip_unknown_fields
optional
#22020
Conversation
2f1edf0
to
c25c533
Compare
Modified the changelog from |
I wonder if we can avoid a breaking change, if we set it to |
The issue is that the Instead, Vector was incorrectly using the See vector/src/sinks/clickhouse/service.rs Lines 138 to 140 in 0b801eb
What needs to happen is if There's 3 cases:
At least, that's based on my understanding of #22013. If I'm in error, I'll gladly make the change, that's just my interpretation. |
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.
Awesome, thank you @PriceHiller . This is a breaking change, but I'd argue that the behavior you have here is what users would have reasonably expected: if they explicitly set false
it should set input_format_skip_unknown_fields=0
.
Problem: The Clickhouse sink's `skip_unknown_fields` doesn't follow the Clickhouse server default. It always sends a value for `skip_unknown_fields`; furthermore, there is also no way to _disable_ `skip_unknown_fields` setting a "strict" mode for Clickhouse. We really want to permit either a default value from the Clickhouse server, meaning we shouldn't specify `skip_unknown_fields` by default. Otherwise, if a user _wants_ to specify the strict mode for unknown fields, they should then pass either `true` or `false` for click house. Solution: Change the `skip_unknown_fields` value to be of an `Option<bool>` instead of just a `bool`. This permits using the defaults provided by the Clickhouse server and doesn't send the `skip_unknown_fields` value to the server if left unspecified. See vectordotdev#22013 for the original issue report. Closes vectordotdev#22013
c25c533
to
2e22b55
Compare
Sorry about the delay, just updated the |
Summary
Copied from the body of the commit:
Allow the
skip_unknown_fields
setting to be optional, thereby allowing use of the defaults provided by the ClickHouse server. Setting it totrue
will permit skipping unknown fields andfalse
will make ClickHouse strict on what fields it accepts.NOTE: I am unfamiliar with ClickHouse and Vector's code as a whole, so it is very possible I have missed something.
Also, does this qualify as a
Bug fix
or aNew feature
? Technically this does add functionality that didn't exist previously, but does so by encoding a fix.Change Type
Is this a breaking change?
How did you test this PR?
By running:
cargo test --lib --no-default-features --features "sinks-console,sinks-clickhouse,clickhouse-integration-tests" 'sinks::clickhouse::service'
cargo test --lib --no-default-features --features "sinks-console,sinks-clickhouse,clickhouse-integration-tests" 'sinks::clickhouse::config'
make test-integration-clickhouse
Does this PR include user facing changes?
Checklist
Cargo.lock
), pleaserun
dd-rust-license-tool write
to regenerate the license inventory and commit the changes (if any). More details here.References