v.22.12New Feature
Add BSONEachRow Input/Output Format to ClickHouse
Add BSONEachRow input/output format. In this format, ClickHouse formats/parses each row as a separate BSON document and each column is formatted/parsed as a single BSON field with the column name as the key. #42033 (mark-polokhov).Why it matters
This feature allows seamless integration with systems and applications that use BSON, enabling efficient serialization and deserialization of table rows to and from BSON documents. It simplifies data exchange by representing rows in a widely-used binary JSON format, improving interoperability and potentially enhancing performance for BSON-based workflows.How to use it
To use this format, specifyFORMAT BSONEachRow in your queries. For example, to export data you can run: SELECT * FROM table FORMAT BSONEachRow. To insert data in this format, use: INSERT INTO table FORMAT BSONEachRow. ClickHouse will then parse or generate BSON documents accordingly, with each row as a BSON document and each column as a field keyed by the column name.