Project: ClickHouse (App Definition and Development / Database)
File: settings-formats.md

sidebar_label: Format Settings sidebar_position: 52 slug: /en/operations/settings/formats tocmaxheading_level: 2 Enables or disables showing secrets in `SHOW` and `SELECT` queries for tables, databases, table functions, and dictionaries. User wishing to see secrets must also have turned on and a privilege. Possible values: 0 Disabled. 1 Enabled. Default value: 0. Enables or disables skipping insertion of extra data. When writing data, ClickHouse throws an exception if input data contain columns that do not exist in the target table. If skipping is enabled, ClickHouse does not insert extra data and does not throw an exception. Supported formats: (and other JSON formats) (and other JSON formats) All formats with suffixes WithNames/WithNamesAndTypes Possible values: 0 Disabled. 1 Enabled. Default value: 1. Enables or disables checking the column order when inserting data. To improve insert performance, we recommend disabling this check if you are sure that the column order of the input data is the same as in the target table. Supported formats: Possible values: 0 Disabled. 1 Enabled. Default value: 1. Controls whether format parser should check if data types from the input data match data types from the target table. Supported formats: Possible values: 0 Disabled. 1 Enabled. Default value: 1. When performing `INSERT` queries, replace omitted input column values with default values of the respective columns. This option applies to (and other JSON formats), , , , , , , , formats and formats with `WithNames`/`WithNamesAndTypes` suffixes. :::note When this option is enabled, extended table metadata are sent from server to client. It consumes additional computing resources on the server and can reduce performance. ::: Possible values: 0 Disabled. 1 Enabled. Default value: 1. Enables or disables the initialization of fields with , if data type of these fields is not . If column type is not nullable and this setting is disabled, then inserting `NULL` causes an exception. If column type is nullable, then `NULL` values are inserted as is, regardless of this setting. This setting is applicable for most input formats. For complex default expressions `inputformatdefaultsforomitted_fields` must be enabled too. Possible values: 0 Inserting `NULL` into a not nullable column causes an exception. 1 `NULL` fields are initialized with default column values. Default value: `1`. Allow seeks while reading in ORC/Parquet/Arrow input formats. Enabled by default. The maximum rows of data to read for automatic schema inference. Default value: `25'000`. The maximum amount of data in bytes to read for automatic schema inference. Default value: `33554432` (32 Mb). The list of column names to use in schema inference for formats without column names. The format: 'column1,column2,column3,...' The list of column names and types to use as hints in schema inference for formats without schema. Example: Query: ```sql desc format(JSONEachRow, '{"x" : 1, "y" : "String", "z" : "0.0.0.0" }') settings schemainferencehints='x UInt8, z IPv4'; ``` Result: ```sql x UInt8 y Nullable(String) z IPv4 ``` :::note If the `schemainferencehints` is not formated properly, or if there is a typo or a wrong datatype, etc... the whole schemainferencehints will be ignored. ::: Controls making inferred types `Nullable` in schema inference for formats without information about nullability. If the setting is enabled, the inferred type will be `Nullable` only if column contains `NULL` in a sample that is parsed during schema inference. Default value:

If enabled, ClickHouse will try to infer integers instead of floats in schema inference for text formats. If all numbers in the column from input data are integers, the result type will be `Int64`, if at least one number is float, the result type will be `Float64`. Enabled by default. If enabled, ClickHouse will try to infer type `Date` from string fields in schema inference for text formats. If all fields from a column in input data were successfully parsed as dates, the result type will be `Date`, if at least one field was not parsed as date, the result type will be `String`. Enabled by default. If enabled, ClickHouse will try to infer type `DateTime64` from string fields in schema inference for text formats. If all fields from a column in input data were successfully parsed as datetimes, the result type will be `DateTime64`, if at least one field was not parsed as datetime, the result type will be `String`. Enabled by default. Allows choosing a parser of the text representation of date and time. The setting does not apply to . Possible values: `'best_effort'` Enables extended parsing. ClickHouse can parse the basic `YYYY-MM-DD HH:MM:SS` format and all date and time formats. For example, `'2018-06-08T01:02:03.000Z'`. `'basic'` Use basic parser. ClickHouse can parse only the basic `YYYY-MM-DD HH:MM:SS` or `YYYY-MM-DD` format. For example, `2019-08-20 10:18:56` or `2019-08-20`. Default value: `'basic'`. Cloud default value: `'best_effort'`. See also: Allows choosing different output formats of the text representation of date and time. Possible values: `simple` - Simple output format. ClickHouse output date and time `YYYY-MM-DD hh:mm:ss` format. For example, `2019-08-20 10:18:56`. The calculation is performed according to the data type's time zone (if present) or server time zone. `iso` - ISO output format. ClickHouse output date and time in `YYYY-MM-DDThh:mm:ssZ` format. For example, `2019-08-20T10:18:56Z`. Note that output is in UTC (`Z` means UTC). `unix_timestamp` - Unix timestamp output format. ClickHouse output date and time in format. For example `1566285536`. Default value: `simple`. See also: Allows choosing different output formats of the text representation of interval types. Possible values: `kusto` - KQL-style output format. ClickHouse outputs intervals in . For example, `toIntervalDay(2)` would be formatted as `2.00:00:00`. Please note that for interval types of varying length (ie. `IntervalMonth` and `IntervalYear`) the average number of seconds per interval is taken into account. `numeric` - Numeric output format. ClickHouse outputs intervals as their underlying numeric representation. For example, `toIntervalDay(2)` would be formatted as `2`. Default value: `numeric`. See also: Deserialization of IPv4 will use default values instead of throwing exception on conversion error. Disabled by default. Deserialization of IPV6 will use default values instead of throwing exception on conversion error. Disabled by default. Text to represent true bool value in TSV/CSV/Vertical/Pretty formats. Default value: `true` Text to represent false bool value in TSV/CSV/Vertical/Pretty formats. Default value: `false` Output trailing zeros when printing Decimal values. E.g. 1.230000 instead of 1.23. Disabled by default. Sets the maximum number of acceptable errors when reading from text formats (CSV, TSV, etc.). The default value is 0. Always pair it with `inputformatallowerrorsratio`. If an error occurred while reading rows but the error counter is still less than `inputformatallowerrorsnum`, ClickHouse ignores the row and moves on to the next one. If both `inputformatallowerrorsnum` and `inputformatallowerrorsratio` are exceeded, ClickHouse throws an

Sets the maximum percentage of errors allowed when reading from text formats (CSV, TSV, etc.). The percentage of errors is set as a floating-point number between 0 and 1. The default value is 0. Always pair it with `inputformatallowerrorsnum`. If an error occurred while reading rows but the error counter is still less than `inputformatallowerrorsratio`, ClickHouse ignores the row and moves on to the next one. If both `inputformatallowerrorsnum` and `inputformatallowerrorsratio` are exceeded, ClickHouse throws an exception. This parameter is useful when you are using formats that require a schema definition, such as or . The value depends on the format. The path to the file where the automatically generated schema will be saved in or formats. Enable streaming in output formats that support it. Disabled by default. Write statistics about read rows, bytes, time elapsed in suitable output formats. Enabled by default Enables or disables random shard insertion into a table when there is no distributed key. By default, when inserting data into a `Distributed` table with more than one shard, the ClickHouse server will reject any insertion request if there is no distributed key. When `insertdistributedonerandomshard = 1`, insertions are allowed and data is forwarded randomly among all shards. Possible values: 0 Insertion is rejected if there are multiple shards and no distributed key is given. 1 Insertion is done randomly among all available shards when no distributed key is given. Default value: `0`. Enables or disables the insertion of JSON data with nested objects. Supported formats: Possible values: 0 Disabled. 1 Enabled. Default value: 0. See also: with the `JSONEachRow` format. Allow parsing bools as numbers in JSON input formats. Enabled by default. Allow parsing bools as strings in JSON input formats. Enabled by default. Allow parsing numbers as strings in JSON input formats. Enabled by default. If enabled, during schema inference ClickHouse will try to infer numbers from string fields. It can be useful if JSON data contains quoted UInt64 numbers. Disabled by default. Allow parsing JSON objects as strings in JSON input formats. Example: ```sql SET inputformatjsonreadobjectsasstrings = 1; CREATE TABLE test (id UInt64, obj String, date Date) ENGINE=Memory(); INSERT INTO test FORMAT JSONEachRow {"id" : 1, "obj" : {"a" : 1, "b" : "Hello"}, "date" : "2020-01-01"}; SELECT * FROM test; ``` Result: ``` idobjdate 1 {"a" : 1, "b" : "Hello"} 2020-01-01 ``` Enabled by default. If enabled, during schema inference ClickHouse will try to infer named Tuple from JSON objects. The resulting named Tuple will contain all elements from all corresponding JSON objects from sample data. Example: ```sql SET inputformatjsontryinfernamedtuplesfromobjects = 1; DESC format(JSONEachRow, '{"obj" : {"a" : 42, "b" : "Hello"}}, {"obj" : {"a" : 43, "c" : [1, 2, 3]}}, {"obj" : {"d" : {"e" : 42}}}') ``` Result: ``` nametypedefaulttypedefaultexpressioncommentcodecexpressionttlexpression obj Tuple(a Nullable(Int64), b Nullable(String), c Array(Nullable(Int64)), d Tuple(e Nullable(Int64))) ``` Enabled by default. Allow parsing JSON arrays as strings in JSON input formats. Example: ```sql SET inputformatjsonreadarraysasstrings = 1; SELECT arr, toTypeName(arr), JSONExtractArrayRaw(arr)[3] from format(JSONEachRow, 'arr String', '{"arr" : [1, "Hello", [1,2,3]]}'); ``` Result: ``` arrtoTypeName(arr)arrayElement(JSONExtractArrayRaw(arr), 3) [1, "Hello", [1,2,3]] String [1,2,3] ``` Enabled by default. Allow to use String type for JSON keys that contain only `Null`/`{}`/`[]` in data sample during schema

In JSON formats any value can be read as String, and we can avoid errors like `Cannot determine type for column 'column_name' by first 25000 rows of data, most likely this column contains only Nulls or empty Arrays/Maps` during schema inference by using String type for keys with unknown types. Example: ```sql SET inputformatjsoninferincompletetypesasstrings = 1, inputformatjsontryinfernamedtuplesfrom_objects = 1; DESCRIBE format(JSONEachRow, '{"obj" : {"a" : [1,2,3], "b" : "hello", "c" : null, "d" : {}, "e" : []}}'); SELECT * FROM format(JSONEachRow, '{"obj" : {"a" : [1,2,3], "b" : "hello", "c" : null, "d" : {}, "e" : []}}'); ``` Result: ``` nametypedefaulttypedefaultexpressioncommentcodecexpressionttlexpression obj Tuple(a Array(Nullable(Int64)), b Nullable(String), c Nullable(String), d Nullable(String), e Array(Nullable(String))) obj ([1,2,3],'hello',NULL,'{}',[]) ``` Enabled by default. For JSON/JSONCompact/JSONColumnsWithMetadata input formats, if this setting is set to 1, the types from metadata in input data will be compared with the types of the corresponding columns from the table. Enabled by default. Controls quoting of 64-bit or bigger (like `UInt64` or `Int128`) when they are output in a format. Such integers are enclosed in quotes by default. This behavior is compatible with most JavaScript implementations. Possible values: 0 Integers are output without quotes. 1 Integers are enclosed in quotes. Default value: 1. Controls quoting of 64-bit when they are output in JSON* formats. Disabled by default. Enables `+nan`, `-nan`, `+inf`, `-inf` outputs in output format. Possible values: 0 Disabled. 1 Enabled. Default value: 0. Example Consider the following table `account_orders`: ```text idnamedurationperiodarea 1 Andrew 20 0 400 2 John 40 0 0 3 Bob 15 0 -100 ``` When `outputformatjsonquotedenormals = 0`, the query returns `null` values in output: ```sql SELECT area/period FROM account_orders FORMAT JSON; ``` ```json { "meta": [ { "name": "divide(area, period)", "type": "Float64" } ], "data": [ { "divide(area, period)": null }, { "divide(area, period)": null }, { "divide(area, period)": null } ], "rows": 3, "statistics": { "elapsed": 0.003648093, "rows_read": 3, "bytes_read": 24 } } ``` When `outputformatjsonquotedenormals = 1`, the query returns: ```json { "meta": [ { "name": "divide(area, period)", "type": "Float64" } ], "data": [ { "divide(area, period)": "inf" }, { "divide(area, period)": "-nan" }, { "divide(area, period)": "-inf" } ], "rows": 3, "statistics": { "elapsed": 0.000070241, "rows_read": 3, "bytes_read": 24 } } ``` Controls quoting of decimals in JSON output formats. Disabled by default. 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. Serialize named tuple columns as JSON objects. Enabled by default. Parse named tuple columns as JSON objects. Enabled by default. Ignore unknown keys in json object for named tuples. Enabled by default. Insert default values for missing elements in JSON object while parsing named tuple. This setting works only when setting `inputformatjsonnamedtuplesasobjects` is enabled. Enabled by default. Throw an exception if JSON string contains bad escape sequence in JSON input formats. If disabled, bad escape sequences will remain as is in the data. Enabled by default. Enables the ability to output all rows as a JSON array in the 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. Default value:

Example of a query with the enabled setting Query: ```sql SET outputformatjsonarrayof_rows = 1; SELECT number FROM numbers(3) FORMAT JSONEachRow; ``` Result: ```text [ {"number":"0"}, {"number":"1"}, {"number":"2"} ] ``` Example of a query with the disabled setting Query: ```sql SET outputformatjsonarrayof_rows = 0; SELECT number FROM numbers(3) FORMAT JSONEachRow; ``` Result: ```text {"number":"0"} {"number":"1"} {"number":"2"} ``` Controls validation of UTF-8 sequences in JSON output formats, doesn't impact formats JSON/JSONCompact/JSONColumnsWithMetadata, they always validate UTF-8. Disabled by default. The name of column that will be used for storing/writing object names in format. Column type should be String. If value is empty, default names `row_{i}`will be used for object names. Default value: ''. Allow variable number of columns in rows in JSONCompact/JSONCompactEachRow input formats. Ignore extra columns in rows with more columns than expected and treat missing columns as default values. Disabled by default. When enabled, escape special characters in Markdown. defines the following special characters that can be escaped by \: ``` ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ ``` Possible values: 0 Disable. 1 Enable. Default value: 0. When enabled, replace empty input fields in TSV with default values. For complex default expressions `inputformatdefaultsforomitted_fields` must be enabled too. Disabled by default. When enabled, always treat enum values as enum ids for TSV input format. It's recommended to enable this setting if data contains only enum ids to optimize enum parsing. Possible values: 0 Enum values are parsed as values or as enum IDs. 1 Enum values are parsed only as enum IDs. Default value: 0. Example Consider the table: ```sql CREATE TABLE tablewithenumcolumnfortsvinsert (Id Int32,Value Enum('first' = 1, 'second' = 2)) ENGINE=Memory(); ``` When the `inputformattsvenumas_number` setting is enabled: Query: ```sql SET inputformattsvenumas_number = 1; INSERT INTO tablewithenumcolumnfortsvinsert FORMAT TSV 102 2; SELECT * FROM tablewithenumcolumnfortsvinsert; ``` Result: ```text IdValue 102 second ``` Query: ```sql SET inputformattsvenumas_number = 1; INSERT INTO tablewithenumcolumnfortsvinsert FORMAT TSV 103 'first'; ``` throws an exception. When the `inputformattsvenumas_number` setting is disabled: Query: ```sql SET inputformattsvenumas_number = 0; INSERT INTO tablewithenumcolumnfortsvinsert FORMAT TSV 102 2; INSERT INTO tablewithenumcolumnfortsvinsert FORMAT TSV 103 'first'; SELECT * FROM tablewithenumcolumnfortsvinsert; ``` Result: ```text IdValue 102 second IdValue 103 first ``` Use some tweaks and heuristics to infer schema in TSV format. If disabled, all fields will be treated as String. Enabled by default. The number of lines to skip at the beginning of data in TSV input format. Default value: `0`. Use DOC/Windows-style line separator (CRLF) in TSV instead of Unix style (LF). Disabled by default. Defines the representation of `NULL` for output and input formats. User can set any string as a value, for example, `My NULL`. Default value: `\N`. Examples Query ```sql SELECT * FROM tsvcustomnull FORMAT TSV; ``` Result ```text 788 \N \N ``` Query ```sql SET formattsvnull_representation = 'My NULL'; SELECT * FROM tsvcustomnull FORMAT TSV; ``` Result ```text 788 My NULL My NULL ``` When enabled, trailing empty lines at the end of TSV file will be skipped. Disabled by default. Allow variable number of columns in rows in TSV input format. Ignore extra columns in rows with more columns than expected and treat missing columns as default values. Disabled by default. The character is interpreted as a delimiter in the CSV data. Default value:

If it is set to true, allow strings in single quotes. Disabled by default. If it is set to true, allow strings in double quotes. Enabled by default. Use DOS/Windows-style line separator (CRLF) in CSV instead of Unix style (LF). Disabled by default. If it is set true, CR(\\r) will be allowed at end of line not followed by LF(\\n) Disabled by default. When enabled, always treat enum values as enum ids for CSV input format. It's recommended to enable this setting if data contains only enum ids to optimize enum parsing. Possible values: 0 Enum values are parsed as values or as enum IDs. 1 Enum values are parsed only as enum IDs. Default value: 0. Examples Consider the table: ```sql CREATE TABLE tablewithenumcolumnforcsvinsert (Id Int32,Value Enum('first' = 1, 'second' = 2)) ENGINE=Memory(); ``` When the `inputformatcsvenumas_number` setting is enabled: Query: ```sql SET inputformatcsvenumas_number = 1; INSERT INTO tablewithenumcolumnforcsvinsert FORMAT CSV 102,2 ``` Result: ```text IdValue 102 second ``` Query: ```sql SET inputformatcsvenumas_number = 1; INSERT INTO tablewithenumcolumnforcsvinsert FORMAT CSV 103,'first' ``` throws an exception. When the `inputformatcsvenumas_number` setting is disabled: Query: ```sql SET inputformatcsvenumas_number = 0; INSERT INTO tablewithenumcolumnforcsvinsert FORMAT CSV 102,2 INSERT INTO tablewithenumcolumnforcsvinsert FORMAT CSV 103,'first' SELECT * FROM tablewithenumcolumnforcsvinsert; ``` Result: ```text IdValue 102 second IdValue 103 first ``` When reading Array from CSV, expect that its elements were serialized in nested CSV and then put into string. Example: "[""Hello"", ""world"", ""42"""" TV""]". Braces around array can be omitted. Disabled by default. When enabled, replace empty input fields in CSV with default values. For complex default expressions `inputformatdefaultsforomitted_fields` must be enabled too. Enabled by default. Use some tweaks and heuristics to infer schema in CSV format. If disabled, all fields will be treated as String. Enabled by default. The number of lines to skip at the beginning of data in CSV input format. Default value: `0`. Defines the representation of `NULL` for output and input formats. User can set any string as a value, for example, `My NULL`. Default value: `\N`. Examples Query ```sql SELECT * from csvcustomnull FORMAT CSV; ``` Result ```text 788 \N \N ``` Query ```sql SET formatcsvnull_representation = 'My NULL'; SELECT * FROM csvcustomnull FORMAT CSV; ``` Result ```text 788 My NULL My NULL ``` When enabled, trailing empty lines at the end of CSV file will be skipped. Disabled by default. Trims spaces and tabs in non-quoted CSV strings. Default value: `true`. Examples Query ```bash echo ' string ' | ./clickhouse local -q "select * from table FORMAT CSV" --input-format="CSV" --inputformatcsvtrimwhitespaces=true ``` Result ```text "string" ``` Query ```bash echo ' string ' | ./clickhouse local -q "select * from table FORMAT CSV" --input-format="CSV" --inputformatcsvtrimwhitespaces=false ``` Result ```text " string " ``` Allow variable number of columns in rows in CSV input format. Ignore extra columns in rows with more columns than expected and treat missing columns as default values. Disabled by default. Allow to use whitespace or tab as field delimiter in CSV strings. Default value: `false`. Examples Query ```bash echo 'a b' | ./clickhouse local -q "select * from table FORMAT CSV" --input-format="CSV" --inputformatcsvallowwhitespaceortabasdelimiter=true --formatcsvdelimiter=' ' ``` Result ```text a b ``` Query ```bash echo 'a b' |

local -q "select * from table FORMAT CSV" --input-format="CSV" --inputformatcsvallowwhitespaceortabasdelimiter=true --formatcsvdelimiter='\t' ``` Result ```text a b ``` Allow to set default value to column when CSV field deserialization failed on bad value Default value: `false`. Examples Query ```bash ./clickhouse local -q "create table test_tbl (x String, y UInt32, z Date) engine=MergeTree order by x" echo 'a,b,c' | ./clickhouse local -q "INSERT INTO testtbl SETTINGS inputformatcsvusedefaultonbadvalues=true FORMAT CSV" ./clickhouse local -q "select * from test_tbl" ``` Result ```text a 0 1971-01-01 ``` If enabled, during schema inference ClickHouse will try to infer numbers from string fields. It can be useful if CSV data contains quoted UInt64 numbers. Disabled by default. Enables or disables the full SQL parser if the fast stream parser cant parse the data. This setting is used only for the format at the data insertion. For more information about syntax parsing, see the section. Possible values: 0 Disabled. In this case, you must provide formatted data. See the section. 1 Enabled. In this case, you can use an SQL expression as a value, but data insertion is much slower this way. If you insert only formatted data, then ClickHouse behaves as if the setting value is 0. Default value: 1. Example of Use Insert the type value with the different settings. ``` sql SET inputformatvaluesinterpretexpressions = 0; INSERT INTO datetime_t VALUES (now()) ``` ``` text Exception on client: Code: 27. DB::Exception: Cannot parse input: expected ) before: now()): (at row 1) ``` ``` sql SET inputformatvaluesinterpretexpressions = 1; INSERT INTO datetime_t VALUES (now()) ``` ``` text Ok. ``` The last query is equivalent to the following: ``` sql SET inputformatvaluesinterpretexpressions = 0; INSERT INTO datetime_t SELECT now() ``` ``` text Ok. ``` Enables or disables template deduction for SQL expressions in format. It allows parsing and interpreting expressions in `Values` much faster if expressions in consecutive rows have the same structure. ClickHouse tries to deduce the template of an expression, parse the following rows using this template and evaluate the expression on a batch of successfully parsed rows. Possible values: 0 Disabled. 1 Enabled. Default value: 1. For the following query: ``` sql INSERT INTO test VALUES (lower('Hello')), (lower('world')), (lower('INSERT')), (upper('Values')), ... ``` If `inputformatvaluesinterpretexpressions=1` and `formatvaluesdeducetemplatesof_expressions=0`, expressions are interpreted separately for each row (this is very slow for large number of rows). If `inputformatvaluesinterpretexpressions=0` and `formatvaluesdeducetemplatesof_expressions=1`, expressions in the first, second and third rows are parsed using template `lower(String)` and interpreted together, expression in the forth row is parsed with another template (`upper(String)`). If `inputformatvaluesinterpretexpressions=1` and `formatvaluesdeducetemplatesof_expressions=1`, the same as in previous case, but also allows fallback to interpreting expressions separately if its not possible to deduce template. This setting is used only when `inputformatvaluesdeducetemplatesofexpressions = 1`. Expressions for some column may have the same structure, but contain numeric literals of different types, e.g. ``` sql (..., abs(0), ...), -- UInt64 literal (..., abs(3.141592654), ...), -- Float64 literal (..., abs(-1), ...), -- Int64 literal ``` Possible values: 0 Disabled. In this case, ClickHouse may use a more general type for some literals (e.g.,`Float64` or `Int64` instead of `UInt64` for `42`), but it may cause overflow and precision issues. 1 Enabled. In this case, ClickHouse checks the actual type of literal and uses an expression template of the corresponding type. In some cases, it may significantly slow down expression evaluation in `Values`. Default value: 1. Ignore case when matching Arrow column names with ClickHouse column

Disabled by default. While importing data, when column is not found in schema default value will be used instead of error. Disabled by default. Allow skipping columns with unsupported types while schema inference for format Arrow. Disabled by default. Allows to convert the type to the `DICTIONARY` type of the format for `SELECT` queries. Possible values: 0 The `LowCardinality` type is not converted to the `DICTIONARY` type. 1 The `LowCardinality` type is converted to the `DICTIONARY` type. Default value: `0`. Use signed integer types instead of unsigned in `DICTIONARY` type of the format during output when `outputformatarrowlowcardinalityasdictionary` is enabled. Possible values: 0 Unsigned integer types are used for indexes in `DICTIONARY` type. 1 Signed integer types are used for indexes in `DICTIONARY` type. Default value: `1`. Use 64-bit integer type in `DICTIONARY` type of the format during output when `outputformatarrowlowcardinalityasdictionary` is enabled. Possible values: 0 Type for indexes in `DICTIONARY` type is determined automatically. 1 64-bit integer type is used for indexes in `DICTIONARY` type. Default value: `0`. Use Arrow String type instead of Binary for String columns. Disabled by default. Use Arrow FIXEDSIZEBINARY type instead of Binary/String for FixedString columns. Enabled by default. Compression method used in output Arrow format. Supported codecs: `lz4_frame`, `zstd`, `none` (uncompressed) Default value: `lz4_frame`. Batch size when reading ORC stripes. Default value: `100'000` Ignore case when matching ORC column names with ClickHouse column names. Disabled by default. While importing data, when column is not found in schema default value will be used instead of error. Disabled by default. Allow skipping columns with unsupported types while schema inference for format Arrow. Disabled by default. Use ORC String type instead of Binary for String columns. Disabled by default. Compression method used in output ORC format. Supported codecs: `lz4`, `snappy`, `zlib`, `zstd`, `none` (uncompressed) Default value: `none`. Ignore case when matching Parquet column names with ClickHouse column names. Disabled by default. Row group size in rows. Default value: `1'000'000`. While importing data, when column is not found in schema default value will be used instead of error. Enabled by default. Allow skipping columns with unsupported types while schema inference for format Parquet. Disabled by default. min bytes required for local read (file) to do seek, instead of read with ignore in Parquet input format. Default value - `8192`. Use Parquet String type instead of Binary for String columns. Disabled by default. Use Parquet FIXEDLENGTHBYTE_ARRAY type instead of Binary/String for FixedString columns. Enabled by default. The version of Parquet format used in output format. Supported versions: `1.0`, `2.4`, `2.6` and `2.latest`. Default value: `2.latest`. Compression method used in output Parquet format. Supported codecs: `snappy`, `lz4`, `brotli`, `zstd`, `gzip`, `none` (uncompressed) Default value: `lz4`. Delimiter between fields in Hive Text File. Default value: `\x01`. Delimiter between collection(array or map) items in Hive Text File. Default value: `\x02`. Delimiter between a pair of map key/values in Hive Text File. Default value: `\x03`. The number of columns in inserted MsgPack data. Used for automatic schema inference from data. Default value: `0`. The way how to output UUID in MsgPack format. Possible values: `bin` - as 16-bytes binary. `str` - as a string of 36 bytes. `ext` - as extension with ExtType = 2. Default value: `ext`. Enable Google wrappers for regular non-nested columns, e.g.

'str' for String column 'str'. For Nullable columns empty wrappers are recognized as defaults, and missing as nulls. Disabled by default. When serializing Nullable columns with Google wrappers, serialize default values as empty wrappers. If turned off, default and null values are not serialized. Disabled by default. Use autogenerated Protobuf schema when is not set. The schema is generated from ClickHouse table structure using function Enables using fields that are not specified in or format schema. When a field is not found in the schema, ClickHouse uses the default value instead of throwing an exception. Possible values: 0 Disabled. 1 Enabled. Default value: 0. Sets URL to use with format. Format: ``` text http://[user:password@]machine[:port]" ``` Examples: ``` text http://registry.example.com:8081 http://admin:secret@registry.example.com:8081 ``` Default value: `Empty`. Sets the compression codec used for output Avro file. Type: string Possible values: `null` No compression `deflate` Compress with Deflate (zlib) `snappy` Compress with Default value: `snappy` (if available) or `deflate`. Sets minimum data size (in bytes) between synchronization markers for output Avro file. Type: unsigned int Possible values: 32 (32 bytes) - 1073741824 (1 GiB) Default value: 32768 (32 KiB) Regexp of column names of type String to output as Avro `string` (default is `bytes`). RE2 syntax is supported. Type: string Max rows in a file (if permitted by storage). Default value: `1`. Rows limit for Pretty formats. Default value: `10'000`. Maximum width to pad all values in a column in Pretty formats. Default value: `250`. Limits the width of value displayed in formats. If the value width exceeds the limit, the value is cut. Possible values: Positive integer. 0 The value is cut completely. Default value: `10000` symbols. Examples Query: ```sql SET outputformatprettymaxvalue_width = 10; SELECT range(number) FROM system.numbers LIMIT 10 FORMAT PrettyCompactNoEscapes; ``` Result: ```text range(number) [] [0] [0,1] [0,1,2] [0,1,2,3] [0,1,2,3,4 [0,1,2,3,4 [0,1,2,3,4 [0,1,2,3,4 [0,1,2,3,4 ``` Query with zero width: ```sql SET outputformatprettymaxvalue_width = 0; SELECT range(number) FROM system.numbers LIMIT 5 FORMAT PrettyCompactNoEscapes; ``` Result: ```text range(number) ``` Use ANSI escape sequences to paint colors in Pretty formats. possible values: `0` Disabled. Pretty formats do not use ANSI escape sequences. `1` Enabled. Pretty formats will use ANSI escape sequences except for `NoEscapes` formats. `auto` - Enabled if `stdout` is a terminal except for `NoEscapes` formats. Default value is `auto`. Allows changing a charset which is used for printing grids borders. Available charsets are UTF-8, ASCII. Example ``` text SET outputformatprettygridcharset = 'UTF-8'; SELECT * FROM a; a 1 SET outputformatprettygridcharset = 'ASCII'; SELECT * FROM a; +-a-+ | 1 | ++ ``` Adds row numbers to output in the format. Possible values: 0 Output without row numbers. 1 Output with row numbers. Default value: `1`. Example Query: ```sql SET outputformatprettyrownumbers = 1; SELECT TOP 3 name, value FROM system.settings; ``` Result: ```text namevalue mincompressblock_size 65536 maxcompressblock_size 1048576 maxblocksize 65505 ``` Print a readable number tip on the right side of the table if the block consists of a single number which exceeds this value (except 0). Possible values: 0 The readable number tip will not be printed. Positive integer The readable number tip will be printed if the single number exceeds this value. Default value: `1000000`. Example Query: ```sql SELECT 1000000000 as a; ``` Result: ```text a 1000000000 --

billion ``` Path to file which contains format string for result set (for Template format). Format string for result set (for Template format) Path to file which contains format string for rows (for Template format). Delimiter between rows (for Template format). Format string for rows (for Template format) Sets the field escaping rule for data format. Possible values: `'Escaped'` Similarly to . `'Quoted'` Similarly to . `'CSV'` Similarly to . `'JSON'` Similarly to . `'XML'` Similarly to . `'Raw'` Extracts subpatterns as a whole, no escaping rules, similarly to . Default value: `'Escaped'`. Sets the character that is interpreted as a delimiter between the fields for data format. Default value: `'\t'`. Sets the character that is interpreted as a delimiter before the field of the first column for data format. Default value: `''`. Sets the character that is interpreted as a delimiter after the field of the last column for data format. Default value: `'\n'`. Sets the character that is interpreted as a delimiter between the rows for data format. Default value: `''`. Sets the character that is interpreted as a prefix before the result set for data format. Default value: `''`. Sets the character that is interpreted as a suffix after the result set for data format. Default value: `''`. When enabled, trailing empty lines at the end of file in CustomSeparated format will be skipped. Disabled by default. Allow variable number of columns in rows in CustomSeparated input format. Ignore extra columns in rows with more columns than expected and treat missing columns as default values. Disabled by default. Field escaping rule. Possible values: `'Escaped'` Similarly to . `'Quoted'` Similarly to . `'CSV'` Similarly to . `'JSON'` Similarly to . `'XML'` Similarly to . `'Raw'` Extracts subpatterns as a whole, no escaping rules, similarly to . Default value: `Raw`. Skip lines unmatched by regular expression. Disabled by default. Determines how to map ClickHouse `Enum` data type and `Enum` data type from schema. Possible values: `'by_values'` Values in enums should be the same, names can be different. `'by_names'` Names in enums should be the same, values can be different. `'bynamecase_insensitive'` Names in enums should be the same case-insensitive, values can be different. Default value: `'by_values'`. Use autogenerated CapnProto schema when is not set. The schema is generated from ClickHouse table structure using function The name of the table from which to read data from in MySQLDump input format. Enables matching columns from table in MySQL dump and columns from ClickHouse table by names in MySQLDump input format. Possible values: 0 Disabled. 1 Enabled. Default value: 1. The maximum number of rows in one INSERT statement. Default value: `65505`. The name of table that will be used in the output INSERT statement. Default value: `table`. Include column names in INSERT statement. Default value: `true`. Use REPLACE keyword instead of INSERT. Default value: `false`. Quote column names with "`" characters Default value: `true`. Use BSON String type instead of Binary for String columns. Disabled by default. Allow skipping columns with unsupported types while schema inference for format BSONEachRow. Disabled by default. The maximum allowed size for String in RowBinary format. It prevents allocating large amount of memory in case of corrupted data. 0 means there is no limit. Default value: `1GiB`. Allow types conversion in Native input format between columns from input data and requested columns. Enabled by default.