Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

format_schema_* format settings

These settings are autogenerated from source.

format_schema

This parameter is useful when you are using formats that require a schema definition, such as Cap’n Proto or Protobuf. The value depends on the format.

format_schema_message_name

Version history
VersionDefault valueComment
25.6New 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.

format_schema_source

Type
String
Default
file
Version history
VersionDefault valueComment
25.6fileNew 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.
Navigation