Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for ClickHouse®
  • Getting started
    • All guides
      • Managing extensions
      • Managing a custom geobase
      • Connecting external dictionaries
      • Managing data format schemas
      • Managing machine learning models
      • Setting up access to Object Storage
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Getting a list of format schemas in a cluster
  • Getting detailed information about a format schema
  • Creating a format schema
  • Before adding a format schema
  • Add the format schema
  • Changing a format schema
  • Removing a format schema
  1. Step-by-step guides
  2. Storing and processing data
  3. Managing data format schemas

Managing format schemas in Managed Service for ClickHouse®

Written by
Yandex Cloud
Updated at December 17, 2025
  • Getting a list of format schemas in a cluster
  • Getting detailed information about a format schema
  • Creating a format schema
    • Before adding a format schema
    • Add the format schema
  • Changing a format schema
  • Removing a format schema

In Managed Service for ClickHouse®, you can INSERT and SELECT data in different formats. Most of these formats are self-descriptive. This means that they already contain a format schema that describes valid data types, their order, and representation in this format. Thus, for example, you can insert data directly from a file.

Note

A format schema describes the format of data input or output, while a data schema describes the structure and layout of ClickHouse® databases and tables storing this data. These concepts are not interchangeable.

Cap'n Proto and Protobuf (including ProtobufSingle) data formats do not contain a format schema: data is presented in binary format without any structural details. Before using data in these formats, e.g., inserting data into a table, add a format schema to your Managed Service for ClickHouse® cluster. Thus you will be able to correctly interpret the number, order, and type of values when processing binary data.

You can add one or multiple format schemas to your Managed Service for ClickHouse® cluster and use them to input and output data in the relevant formats.

Warning

To use the format schemas you added, insert the data into Managed Service for ClickHouse® via the HTTP interface. In this case, data serialization and deserialization is performed on the server side based on the schemas you added.

For more information about data formats, see this ClickHouse® guide.

You can find examples of using Cap'n Proto and Protobuf formats when inserting data into a cluster in this tutorial.

Getting a list of format schemas in a clusterGetting a list of format schemas in a cluster

Management console
CLI
REST API
gRPC API
  1. In the management console, select the folder the cluster is in.
  2. Go to Managed Service for ClickHouse.
  3. Click the cluster name and select the Data format schemas tab.

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To get a list of format schemas in a cluster, run this command:

yc managed-clickhouse format-schema list --cluster-name="<cluster_name>"

You can get the cluster name with the list of clusters in the folder.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the FormatSchema.List method, e.g., via the following cURL request:

    curl \
        --request GET \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>/formatSchemas'
    

    You can get the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Call the FormatSchemaService.List method, e.g., via the following gRPCurl request:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/format_schema_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
                "cluster_id": "<cluster_ID>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.FormatSchemaService.List
    

    You can get the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure your request was successful.

Getting detailed information about a format schema {get-format-schema}Getting detailed information about a format schema

CLI
REST API
gRPC API

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To get detailed information about a format schema, run this command:

yc managed-clickhouse format-schema get "<format_schema_name>" \
  --cluster-name="<cluster_name>"

You can get the schema name with the list of format schemas in the cluster, and the cluster name, with the list of clusters in the folder.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the FormatSchema.Get method, e.g., via the following cURL request:

    curl \
        --request GET \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>/formatSchemas/<schema_name>'
    

    You can get the cluster ID with the list of clusters in the folder, and the schema name, with the list of schemas in the cluster.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Call the FormatSchemaService.Get method, e.g., via the following gRPCurl request:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/format_schema_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
                "cluster_id": "<cluster_ID>",
                "format_schema_name": "<schema_name>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.FormatSchemaService.Get
    

    You can get the cluster ID with the list of clusters in the folder, and the schema name, with the list of schemas in the cluster.

  4. View the server response to make sure your request was successful.

ClickHouse® is a registered trademark of ClickHouse, Inc.

Creating a format schemaCreating a format schema

Before adding a format schemaBefore adding a format schema

Managed Service for ClickHouse® only works with format schemas uploaded to Yandex Object Storage and accessible for reading. Before adding a schema to a cluster:

  1. Prepare a file with a format schema (see the Cap'n Proto and Protobuf tutorials).

  2. To attach a service account to a cluster, assign the iam.serviceAccounts.user role or higher to your Yandex Cloud account.

  3. Upload the format schema file to Yandex Object Storage.

  4. Attach the service account to the cluster. You will use this service account to configure permissions to access the schema file.

  5. Assign the storage.viewer role to the service account.

  6. In the bucket ACL, add the READ permission to the service account.

  7. Get a link to the schema file.

Add the format schemaAdd the format schema

Management console
CLI
Terraform
REST API
gRPC API
  1. In the management console, select the folder the cluster is in.
  2. Go to Managed Service for ClickHouse.
  3. Click the cluster name and select the Data format schemas tab.
  4. Click Create schema.
  5. In the Add schema dialog box, fill out the form by specifying the schema file link generated earlier in the URL field.
  6. Click Create.

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To create a format schema, run this command:

  • For Cap'n Proto:

    yc managed-clickhouse format-schema create "<format_schema_name>" \
      --cluster-name="<cluster_name>" \
      --type="capnproto" \
      --uri="<link_to_file_in_Object_Storage>"
    
  • For Protobuf:

    yc managed-clickhouse format-schema create "<format_schema_name>" \
      --cluster-name="<cluster_name>" \
      --type="protobuf" \
      --uri="<link_to_file_in_Object_Storage>"
    

You can get the cluster name with the list of clusters in the folder.

  1. Open the current Terraform configuration file describing your infrastructure.

    For information on how to create such a file, see Creating a cluster.

  2. Add the format_schema section to the Managed Service for ClickHouse® cluster description:

    resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" {
      ...
      format_schema {
        name = "<schema_name>"
        type = "<schema_type>"
        uri  = "<link_to_format_schema_file_in_Object_Storage>"
      }
    }
    

    Where type is the schema type, FORMAT_SCHEMA_TYPE_CAPNPROTO or FORMAT_SCHEMA_TYPE_PROTOBUF.

  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see this Terraform provider guide.

Timeouts

The Terraform provider sets the following timeouts for Managed Service for ClickHouse® cluster operations:

  • Creating a cluster, including by restoring from a backup: 60 minutes.
  • Updating a cluster: 90 minutes.
  • Deleting a cluster: 30 minutes.

Operations exceeding the timeout are aborted.

How do I change these limits?

Add a timeouts section to the cluster description, e.g.:

resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" {
  ...
  timeouts {
    create = "1h30m" # 1 hour 30 minutes
    update = "2h"    # 2 hours
    delete = "30m"   # 30 minutes
  }
}
  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the FormatSchema.Create method, e.g., via the following cURL request:

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://{{ api-host-mdb }/managed-clickhouse/v1/clusters/<cluster_ID>/formatSchemas' \
        --data '{
                  "formatSchemaName": "<schema_name>",
                  "type": "<schema_type>",
                  "uri": "<file_link>"
                }'
    

    Where:

    • formatSchemaName: Schema name.
    • type: Schema type, FORMAT_SCHEMA_TYPE_CAPNPROTO or FORMAT_SCHEMA_TYPE_PROTOBUF.
    • uri: Link to the schema file in Object Storage.

    You can get the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Call the FormatSchemaService.Create method, e.g., via the following gRPCurl request:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/format_schema_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
                "cluster_id": "<cluster_ID>",
                "format_schema_name": "<schema_name>",
                "type": "<schema_type>",
                "uri": "<file_link>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.FormatSchemaService.Create
    

    Where:

    • format_schema_name: Schema name.
    • type: Schema type, FORMAT_SCHEMA_TYPE_CAPNPROTO or FORMAT_SCHEMA_TYPE_PROTOBUF.
    • uri: Link to the schema file in Object Storage.

    You can get the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure your request was successful.

Changing a format schemaChanging a format schema

Managed Service for ClickHouse® does not track changes in a format schema file located in a Yandex Object Storage bucket.

To update the contents of a schema that is already added to the cluster:

  1. Upload the file with the current format schema to Yandex Object Storage.
  2. Get a link to this file.
  3. Update the settings of the format schema added to Managed Service for ClickHouse® by providing a new link to the format schema file.
Management console
CLI
Terraform
REST API
gRPC API
  1. In the management console, select the folder the cluster is in.
  2. Go to Managed Service for ClickHouse.
  3. Click the cluster name and select the Data format schemas tab.
  4. Select the appropriate schema, click , and select Edit.

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To update the link to a format schema file in an object storage, run this command:

yc managed-clickhouse format-schema update "<data_schema_name>" \
  --cluster-name="<cluster_name>" \
  --uri="<new_link_to_file_in_Object_Storage>"

You can get the schema name with the list of format schemas in the cluster, and the cluster name, with the list of clusters in the folder.

  1. Open the current Terraform configuration file describing your infrastructure.

    For information on how to create such a file, see Creating a cluster.

  2. In the Managed Service for ClickHouse® cluster description, change the uri parameter value under format_schema:

    resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" {
      ...
      format_schema {
        name = "<schema_name>"
        type = "<schema_type>"
        uri  = "<new_link_to_schema_file_in_Object_Storage>"
      }
    }
    
  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    For more information, see this Terraform provider guide.

    Timeouts

    The Terraform provider sets the following timeouts for Managed Service for ClickHouse® cluster operations:

    • Creating a cluster, including by restoring from a backup: 60 minutes.
    • Updating a cluster: 90 minutes.
    • Deleting a cluster: 30 minutes.

    Operations exceeding the timeout are aborted.

    How do I change these limits?

    Add a timeouts section to the cluster description, e.g.:

    resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" {
      ...
      timeouts {
        create = "1h30m" # 1 hour 30 minutes
        update = "2h"    # 2 hours
        delete = "30m"   # 30 minutes
      }
    }
    
  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the FormatSchema.Update method, e.g., via the following cURL request:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the updateMask parameter as a single comma-separated string.

    curl \
        --request PATCH \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://{{ api-host-mdb }/managed-clickhouse/v1/clusters/<cluster_ID>/formatSchemas/<schema_name>' \
        --data '{
                  "updateMask": "uri",
                  "uri": "<file_link>"
                }'
    

    Where:

    • updateMask: Comma-separated list of settings you want to update.

      Here, we only specified a single setting, uri.

    • uri: Link to the new schema file in Object Storage.

    You can get the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Call the FormatSchemaService.Update method, e.g., via the following gRPCurl request:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the update_mask parameter as an array of paths[] strings.

    Format for listing settings
    "update_mask": {
        "paths": [
            "<setting_1>",
            "<setting_2>",
            ...
            "<setting_N>"
        ]
    }
    
    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/format_schema_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
                "cluster_id": "<cluster_ID>",
                "format_schema_name": "<schema_name>",
                "update_mask": {
                  "paths": ["uri"]
                },
                "uri": "<file_link>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.FormatSchemaService.Update
    

    Where:

    • format_schema_name: Schema name.

    • update_mask: List of settings you want to update as an array of strings (paths[]).

      Here, we only specified a single setting, uri.

    • uri: Link to the new model file in Object Storage.

    You can get the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure your request was successful.

Removing a format schemaRemoving a format schema

Note

After removing a format schema, the related object remains in the Yandex Object Storage bucket. If you no longer need this schema object, you can delete it.

Management console
CLI
Terraform
REST API
gRPC API
  1. In the management console, select the folder the cluster is in.
  2. Go to Managed Service for ClickHouse.
  3. Click the cluster name and select the Data format schemas tab.
  4. Select the appropriate schema, click , and select Delete.

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To remove a format schema, run this command:

yc managed-clickhouse format-schema delete "<format_schema_name>" \
  --cluster-name="<cluster_name>"

You can get the schema name with the list of format schemas in the cluster, and the cluster name, with the list of clusters in the folder.

  1. Open the current Terraform configuration file describing your infrastructure.

    For information on how to create such a file, see Creating a cluster.

  2. Delete the section describing format_schema in question from the Managed Service for ClickHouse® cluster description.

  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see this Terraform provider guide.

Timeouts

The Terraform provider sets the following timeouts for Managed Service for ClickHouse® cluster operations:

  • Creating a cluster, including by restoring from a backup: 60 minutes.
  • Updating a cluster: 90 minutes.
  • Deleting a cluster: 30 minutes.

Operations exceeding the timeout are aborted.

How do I change these limits?

Add a timeouts section to the cluster description, e.g.:

resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" {
  ...
  timeouts {
    create = "1h30m" # 1 hour 30 minutes
    update = "2h"    # 2 hours
    delete = "30m"   # 30 minutes
  }
}
  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the FormatSchema.Delete method, e.g., via the following cURL request:

    curl \
        --request DELETE \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>/formatSchemas/<schema_name>'
    

    You can get the cluster ID with the list of clusters in the folder, and the schema name, with the list of schemas in the cluster.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Call the FormatSchemaService.Delete method, e.g., via the following gRPCurl request:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/format_schema_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
                "cluster_id": "<cluster_ID>",
                "format_schema_name": "<schema_name>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.FormatSchemaService.Delete
    

    You can get the cluster ID with the list of clusters in the folder, and the schema name, with the list of schemas in the cluster.

  4. View the server response to make sure your request was successful.

Was the article helpful?

Previous
Connecting external dictionaries
Next
Managing machine learning models
© 2026 Direct Cursus Technology L.L.C.