> ## 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.

# format_schema_* format settings

> ClickHouse format settings in the format_schema_* 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="format_schema">
  format\_schema
</h2>

This parameter is useful when you are using formats that require a schema definition, such as [Cap'n Proto](https://capnproto.org/) or [Protobuf](https://developers.google.com/protocol-buffers/). The value depends on the format.

<h2 id="format_schema_message_name">
  format\_schema\_message\_name
</h2>

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.6"},{"label": ""},{"label": "New setting"}]}]} />

Define the name of the required message in the schema defined in `format_schema`.
To maintain compatibility with the legacy format\_schema format (`file_name:message_name`):

* If `format_schema_message_name` is not specified, the message name is inferred from the `message_name` part of the legacy `format_schema` value.
* If `format_schema_message_name` is specified while using the legacy format, an error will be raised.

<h2 id="format_schema_source">
  format\_schema\_source
</h2>

<SettingsInfoBlock type="String" default_value="file" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.6"},{"label": "file"},{"label": "New setting"}]}]} />

Define the source of `format_schema`.
Possible values:

* 'file' (default): The `format_schema` is the name of a schema file located in the `format_schemas` directory.
* 'string': The `format_schema` is the literal content of the schema.
* 'query': The `format_schema` is a query to retrieve the schema.
  When `format_schema_source` is set to 'query', the following conditions apply:
* The query must return exactly one value: a single row with a single string column.
* The result of the query is treated as the schema content.
* This result is cached locally in the `format_schemas` directory.
* You can clear the local cache using the command: `SYSTEM DROP FORMAT SCHEMA CACHE FOR Files`.
* Once cached, identical queries are not executed to fetch the schema again until the cache is explicitly cleared
* In addition to local cache files, Protobuf messages are also cached in memory. Even after clearing the local cache files, the in-memory cache must be cleared using `SYSTEM DROP FORMAT SCHEMA CACHE [FOR Protobuf]` to fully refresh the schema.
* Run the query `SYSTEM DROP FORMAT SCHEMA CACHE` to clear the cache for both cache files and Protobuf messages schemas at once.
