v.25.9New Feature

Support the oneof

Support the oneof indicator in Protobuf inputs. A special column may be used to indicate the presence of part of oneof. If a message contains oneof and input_format_protobuf_oneof_presence is set, ClickHouse fills column that indicates which field of oneof was found. #82885 (Ilya Golshtein).
Support for the oneof indicator in Protobuf inputs, allowing ClickHouse to indicate which field of a oneof union is present in the data.

Why it matters

This feature enables users to identify which specific field of a oneof in Protobuf messages has been set when importing data into ClickHouse. It resolves the problem of ambiguity when multiple fields in a oneof are possible but only one can be present, improving data clarity and enabling more precise queries.

How to use it

To enable this feature, set the parameter input_format_protobuf_oneof_presence when using the Protobuf input format. ClickHouse will then populate a special column that indicates which oneof field was found in each message.