Skip to content

json_compact_columns ​

Description ​

One JSON array containing a value array for each positional column. Column arrays must describe the same row count.

Input and output. Select it with FORMAT json_compact_columns. Names ignore ASCII case; use the snake_case name shown here.

The outer array contains one value array per column. Position in the outer array identifies the destination column; matching positions within those arrays form rows.

All column arrays must describe the same row count. Omitted trailing columns use the configured defaults. There are no named field keys to reorder the source by name.

text
SELECT expressions FORMAT json_compact_columns;
INSERT INTO table [(columns)] [SETTINGS ...] FORMAT json_compact_columns
<data>

Example usage ​

sql
SELECT CAST(7 AS Int64) AS id, 'Ada' AS name FORMAT json_compact_columns;
text
[
    [7],
    ["Ada"]
]

Format settings ​

Use a statement SETTINGS clause; these options are not persisted by SET.

Setting Type Default Meaning
json_compact_columns_sql_defaults Bool 1 Evaluate SQL DEFAULT expressions for omitted trailing input columns; off supplies only their native type defaults.
snappy_mode String basic Read Snappy client files as basic (Hadoop blocks) or framed (standard streaming format).