v.23.8New Feature
Add CapnProto/Protobuf Schema Conversion Functions to ClickHouse
Add new functionsstructureToCapnProtoSchema/structureToProtobufSchemathat convert ClickHouse table structure to CapnProto/Protobuf format schema. Allow to input/output data in CapnProto/Protobuf format without external format schema using autogenerated schema from table structure (controlled by settingsformat_capn_proto_use_autogenerated_schema/format_protobuf_use_autogenerated_schema). Allow to export autogenerated schema while input/output using settingoutput_format_schema. #52278 (Kruglov Pavel).
Why it matters
This feature solves the problem of managing external format schemas when working with Cap'n Proto and Protobuf data. By automatically generating the schema from the ClickHouse table structure, it simplifies data input and output in these formats, reducing complexity and improving integration workflows.How to use it
Use the functionsstructureToCapnProtoSchema or structureToProtobufSchema to generate the schema from a ClickHouse table structure. Enable automatic usage of the autogenerated schema for input/output by setting format_capn_proto_use_autogenerated_schema or format_protobuf_use_autogenerated_schema to 1. Additionally, use the output_format_schema setting to export the autogenerated schema during data processing.