Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

schema_inference_* format settings

These settings are autogenerated from source.

schema_inference_hints

The list of column names and types to use as hints in schema inference for formats without schema.

Example:

Query:

desc format(JSONEachRow, '{"x" : 1, "y" : "String", "z" : "0.0.0.0" }') settings schema_inference_hints='x UInt8, z IPv4';

Result:

x   UInt8
y   Nullable(String)
z   IPv4

schema_inference_make_columns_nullable

Type
UInt64Auto
Default
3

Controls making inferred types Nullable in schema inference. Possible values:

  • 0 - the inferred type will never be Nullable (use input_format_null_as_default to control what do do with null values in this case),
  • 1 - all inferred types will be Nullable,
  • 2 or auto - the inferred type will be Nullable only if the column contains NULL in a sample that is parsed during schema inference or file metadata contains information about column nullability,
  • 3 - the inferred type nullability will match file metadata if the format has it (e.g. Parquet), always Nullable otherwise (e.g. CSV).

schema_inference_make_json_columns_nullable

Type
Bool
Default
0

Controls making inferred JSON types Nullable in schema inference. If this setting is enabled together with schema_inference_make_columns_nullable, inferred JSON type will be Nullable.

schema_inference_mode

Type
SchemaInferenceMode
Default
default

Mode of schema inference. ‘default’ - assume that all files have the same schema and schema can be inferred from any file, ‘union’ - files can have different schemas and the resulting schema should be the a union of schemas of all files

Navigation