Format Settings

ClickHouse outputs intervals as their underlying numeric representation. For example, `toIntervalDay(2)` would be formatted as `2`.

See also:

- [Interval](/docs/sql-reference/data-types/special-data-types/interval)

## into\_outfile\_create\_parent\_directories[​](#into_outfile_create_parent_directories "Direct link to into_outfile_create_parent_directories")

Automatically create parent directories when using INTO OUTFILE if they do not already exists.

## json\_type\_escape\_dots\_in\_keys[​](#json_type_escape_dots_in_keys "Direct link to json_type_escape_dots_in_keys")

When enabled, dots in JSON keys will be escaped during parsing.

## max\_dynamic\_subcolumns\_in\_json\_type\_parsing[​](#max_dynamic_subcolumns_in_json_type_parsing "Direct link to max_dynamic_subcolumns_in_json_type_parsing")

The maximum number of dynamic subcolumns that can be created in every column during parsing of JSON column.
It allows to control the number of dynamic subcolumns during parsing regardless of dynamic parameters specified in the data type.

## output\_format\_arrow\_compression\_method[​](#output_format_arrow_compression_method "Direct link to output_format_arrow_compression_method")

Compression method for Arrow output format. Supported codecs: lz4\_frame, zstd, none (uncompressed)

## output\_format\_arrow\_date\_as\_uint16[​](#output_format_arrow_date_as_uint16 "Direct link to output_format_arrow_date_as_uint16")

Write Date values as plain 16-bit numbers (read back as UInt16), instead of converting to a 32-bit Arrow DATE32 type (read back as Date32).

## output\_format\_arrow\_fixed\_string\_as\_fixed\_byte\_array[​](#output_format_arrow_fixed_string_as_fixed_byte_array "Direct link to output_format_arrow_fixed_string_as_fixed_byte_array")

Use Arrow FIXED\_SIZE\_BINARY type instead of Binary for FixedString columns.

## output\_format\_arrow\_low\_cardinality\_as\_dictionary[​](#output_format_arrow_low_cardinality_as_dictionary "Direct link to output_format_arrow_low_cardinality_as_dictionary")

Enable output LowCardinality type as Dictionary Arrow type

## output\_format\_arrow\_string\_as\_string[​](#output_format_arrow_string_as_string "Direct link to output_format_arrow_string_as_string")

Use Arrow String type instead of Binary for String columns

## output\_format\_arrow\_use\_64\_bit\_indexes\_for\_dictionary[​](#output_format_arrow_use_64_bit_indexes_for_dictionary "Direct link to output_format_arrow_use_64_bit_indexes_for_dictionary")

Always use 64 bit integers for dictionary indexes in Arrow format

## output\_format\_arrow\_use\_signed\_indexes\_for\_dictionary[​](#output_format_arrow_use_signed_indexes_for_dictionary "Direct link to output_format_arrow_use_signed_indexes_for_dictionary")

Use signed integers for dictionary indexes in Arrow format

## output\_format\_avro\_codec[​](#output_format_avro_codec "Direct link to output_format_avro_codec")

Compression codec used for output. Possible values: 'null', 'deflate', 'snappy', 'zstd'.

## output\_format\_avro\_rows\_in\_file[​](#output_format_avro_rows_in_file "Direct link to output_format_avro_rows_in_file")

Max rows in a file (if permitted by storage)

## output\_format\_avro\_string\_column\_pattern[​](#output_format_avro_string_column_pattern "Direct link to output_format_avro_string_column_pattern")

For Avro format: regexp of String columns to select as AVRO string.

## output\_format\_avro\_sync\_interval[​](#output_format_avro_sync_interval "Direct link to output_format_avro_sync_interval")

Sync interval in bytes.

## output\_format\_binary\_encode\_types\_in\_binary\_format[​](#output_format_binary_encode_types_in_binary_format "Direct link to output_format_binary_encode_types_in_binary_format")

Write data types in binary format instead of type names in RowBinaryWithNamesAndTypes output format

## output\_format\_binary\_write\_json\_as\_string[​](#output_format_binary_write_json_as_string "Direct link to output_format_binary_write_json_as_string")

Write values of [JSON](/docs/sql-reference/data-types/newjson) data type as JSON [String](/docs/sql-reference/data-types/string) values in RowBinary output format.

## output\_format\_bson\_string\_as\_string[​](#output_format_bson_string_as_string "Direct link to output_format_bson_string_as_string")

Use BSON String type instead of Binary for String columns.

## output\_format\_compression\_level[​](#output_format_compression_level "Direct link to output_format_compression_level")

Default compression level if query output is compressed. The setting is applied when `SELECT` query has `INTO OUTFILE` or when writing to table functions `file`, `url`, `hdfs`, `s3`, or `azureBlobStorage`.

Possible values: from `1` to `22`

## output\_format\_compression\_zstd\_window\_log[​](#output_format_compression_zstd_window_log "Direct link to output_format_compression_zstd_window_log")

Can be used when the output compression method is `zstd`. If greater than `0`, this setting explicitly sets compression window size (power of `2`) and enables a long-range mode for zstd compression. This can help to achieve a better compression ratio.

Possible values: non-negative numbers. Note that if the value is too small or too big, `zstdlib` will throw an exception. Typical values are from `20` (window size = `1MB`) to `30` (window size = `1GB`).

## output\_format\_csv\_crlf\_end\_of\_line[​](#output_format_csv_crlf_end_of_line "Direct link to output_format_csv_crlf_end_of_line")

If it is set true, end of line in CSV format will be \r\n instead of \n.

## output\_format\_csv\_serialize\_tuple\_into\_separate\_columns[​](#output_format_csv_serialize_tuple_into_separate_columns "Direct link to output_format_csv_serialize_tuple_into_separate_columns")

If it set to true, then Tuples in CSV format are serialized as separate columns (that is, their nesting in the tuple is lost)

## output\_format\_decimal\_trailing\_zeros[​](#output_format_decimal_trailing_zeros "Direct link to output_format_decimal_trailing_zeros")

Output trailing zeros when printing Decimal values. E.g. 1.230000 instead of 1.23.

Disabled by default.

## output\_format\_json\_array\_of\_rows[​](#output_format_json_array_of_rows "Direct link to output_format_json_array_of_rows")

Enables the ability to output all rows as a JSON array in the [JSONEachRow](/docs/interfaces/formats/JSONEachRow) format.

Possible values:

- 1 — ClickHouse outputs all rows as an array, each row in the `JSONEachRow` format.
- 0 — ClickHouse outputs each row separately in the `JSONEachRow` format.

**Example of a query with the enabled setting**

Query:

```
SET output_format_json_array_of_rows = 1;
SELECT number FROM numbers(3) FORMAT JSONEachRow;
```

Result:

```
[
{"number":"0"},
{"number":"1"},
{"number":"2"}
]
```

**Example of a query with the disabled setting**

Query:

```
SET output_format_json_array_of_rows = 0;
SELECT number FROM numbers(3) FORMAT JSONEachRow;
```

Result:

```
{"number":"0"}
{"number":"1"}
{"number":"2"}
```

## output\_format\_json\_escape\_forward\_slashes[​](#output_format_json_escape_forward_slashes "Direct link to output_format_json_escape_forward_slashes")

Controls escaping forward slashes for string outputs in JSON output format. This is intended for compatibility with JavaScript. Don't confuse with backslashes that are always escaped.

Enabled by default.

## output\_format\_json\_map\_as\_array\_of\_tuples[​](#output_format_json_map_as_array_of_tuples "Direct link to output_format_json_map_as_array_of_tuples")

Serialize maps columns as JSON arrays of tuples.

Disabled by default.

## output\_format\_json\_named\_tuples\_as\_objects[​](#output_format_json_named_tuples_as_objects "Direct link to output_format_json_named_tuples_as_objects")

Serialize named tuple columns as JSON objects.

Enabled by default.

## output\_format\_json\_pretty\_print[​](#output_format_json_pretty_print "Direct link to output_format_json_pretty_print")

This setting determines how nested structures such as Tuples, Maps, and Arrays are displayed within the `data` array when using the JSON output format.

For example, instead of output: