-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Clickhouse skip_unknown_fields has no effect #22013
Comments
Thanks @srstrickland . I agree with your assessment. If unspecified, it shouldn't send the option and use the server default. If specified (either |
I'll give it a shot. I haven't used clickhouse before, so additional testing will almost certainly be required. I'm assuming I can just encode that |
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
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
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
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
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 #22013 for the original issue report. Closes #22013
A note for the community
Problem
The clickhouse sink option skip_unknown_fields likely has no effect. I say "likely" because it really depends on what the Clickhouse server settings are. The problem is that this option is enabled in Clickhouse by default.
The way this feature is implemented, vector will only set option
input_format_skip_unknown_fields=1
whenskip_unknown_fields
istrue
. If a user explicitly sets it tofalse
, they might expect the behavior to be "strict"; that any attempts to send data with additional fields will result in an error. But this isn't the case; vector simply won't send the option, and the server setting (default 1) will be used. So with default settings on a Clickhouse instance, there is no way for a user to enable "strict" mode in vector.Using the "server default setting" should remain an option, so perhaps the configuration needs to:
input_format_skip_unknown_fields=1
whenskip_unknown_fields: true
input_format_skip_unknown_fields=0
whenskip_unknown_fields: false
This is a really minor issue, but thought it was worth raising in case anyone else was surprised by the current functionality. It's entirely possible that the Clickhouse default used to be 0, in which case the current implementation makes a bit more sense... but even so, there should be a way to force one way or another from vector's perspective, independent of the CH server settings.
It's likely that the other vector options for the
clickhouse
sink need to similarly consider what to do fortrue
,false
, andnot-set
, as they are all currently implemented as "only do something if true", and this may lead to unexpected behavior depending on the various levels of defaulting going on (in both vector config & clickhouse config).Configuration
Version
0.43.1
Debug Output
No response
Example Data
No response
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: