> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# schema_inference_* format settings

> ClickHouse format settings in the schema_inference_* generated group.

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>Type</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Default</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Changeable without restart
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

These settings are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/FormatFactorySettings.h).

<h2 id="schema_inference_hints">
  schema\_inference\_hints
</h2>

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

Example:

Query:

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

Result:

```sql theme={null}
x   UInt8
y   Nullable(String)
z   IPv4
```

<Note>
  If the `schema_inference_hints` is not formatted properly, or if there is a typo or a wrong datatype, etc... the whole schema\_inference\_hints will be ignored.
</Note>

<h2 id="schema_inference_make_columns_nullable">
  schema\_inference\_make\_columns\_nullable
</h2>

<SettingsInfoBlock type="UInt64Auto" default_value="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).

<h2 id="schema_inference_make_json_columns_nullable">
  schema\_inference\_make\_json\_columns\_nullable
</h2>

<SettingsInfoBlock type="Bool" default_value="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`.

<h2 id="schema_inference_mode">
  schema\_inference\_mode
</h2>

<SettingsInfoBlock type="SchemaInferenceMode" default_value="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
