Yandex Cloud
Search
Discuss with expertTry 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
  • Access management
  • Pricing policy
  • Terraform reference
    • API authentication
      • Overview
        • Overview
        • Get
        • List
        • Create
        • Update
        • Delete
        • AddZookeeper
        • Start
        • Stop
        • Move
        • Backup
        • Restore
        • RescheduleMaintenance
        • ListLogs
        • StreamLogs
        • ListOperations
        • ListBackups
        • ListHosts
        • AddHosts
        • UpdateHosts
        • DeleteHosts
        • RestartHosts
        • GetShard
        • ListShards
        • AddShard
        • AddShards
        • UpdateShard
        • DeleteShard
        • DeleteShards
        • GetShardGroup
        • ListShardGroups
        • CreateShardGroup
        • UpdateShardGroup
        • DeleteShardGroup
        • ListExternalDictionaries
        • CreateExternalDictionary
        • UpdateExternalDictionary
        • DeleteExternalDictionary
        • ListAccessBindings
        • SetAccessBindings
        • UpdateAccessBindings
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • gRPC request
  • UpdateClusterExternalDictionaryRequest
  • ExternalDictionary
  • Structure
  • Id
  • Key
  • Attribute
  • Layout
  • Range
  • HttpSource
  • Header
  • MysqlSource
  • Replica
  • ClickhouseSource
  • MongodbSource
  • PostgresqlSource
  • operation.Operation
  1. API reference
  2. gRPC
  3. Cluster
  4. UpdateExternalDictionary

Managed Service for ClickHouse API, gRPC: ClusterService.UpdateExternalDictionary

Written by
Yandex Cloud
Improved by
Tania L.
Updated at June 1, 2026
  • gRPC request
  • UpdateClusterExternalDictionaryRequest
  • ExternalDictionary
  • Structure
  • Id
  • Key
  • Attribute
  • Layout
  • Range
  • HttpSource
  • Header
  • MysqlSource
  • Replica
  • ClickhouseSource
  • MongodbSource
  • PostgresqlSource
  • operation.Operation

Updates an external dictionary for the specified ClickHouse cluster.

gRPC requestgRPC request

rpc UpdateExternalDictionary (UpdateClusterExternalDictionaryRequest) returns (operation.Operation)

UpdateClusterExternalDictionaryRequestUpdateClusterExternalDictionaryRequest

{
  "cluster_id": "string",
  "external_dictionary": {
    "name": "string",
    "structure": {
      "id": {
        "name": "string"
      },
      "key": {
        "attributes": [
          {
            "name": "string",
            "type": "string",
            "null_value": "string",
            "expression": "string",
            "hierarchical": "bool",
            "injective": "bool"
          }
        ]
      },
      "range_min": {
        "name": "string",
        "type": "string",
        "null_value": "string",
        "expression": "string",
        "hierarchical": "bool",
        "injective": "bool"
      },
      "range_max": {
        "name": "string",
        "type": "string",
        "null_value": "string",
        "expression": "string",
        "hierarchical": "bool",
        "injective": "bool"
      },
      "attributes": [
        {
          "name": "string",
          "type": "string",
          "null_value": "string",
          "expression": "string",
          "hierarchical": "bool",
          "injective": "bool"
        }
      ]
    },
    "layout": {
      "type": "Type",
      "size_in_cells": "int64",
      "allow_read_expired_keys": "google.protobuf.BoolValue",
      "max_update_queue_size": "int64",
      "update_queue_push_timeout_milliseconds": "int64",
      "query_wait_timeout_milliseconds": "int64",
      "max_threads_for_updates": "int64",
      "initial_array_size": "int64",
      "max_array_size": "int64",
      "access_to_key_from_attributes": "google.protobuf.BoolValue"
    },
    // Includes only one of the fields `fixed_lifetime`, `lifetime_range`
    "fixed_lifetime": "int64",
    "lifetime_range": {
      "min": "int64",
      "max": "int64"
    },
    // end of the list of possible fields
    // Includes only one of the fields `http_source`, `mysql_source`, `clickhouse_source`, `mongodb_source`, `postgresql_source`
    "http_source": {
      "url": "string",
      "format": "string",
      "headers": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    },
    "mysql_source": {
      "db": "string",
      "table": "string",
      "port": "int64",
      "user": "string",
      "password": "string",
      "replicas": [
        {
          "host": "string",
          "priority": "int64",
          "port": "int64",
          "user": "string",
          "password": "string"
        }
      ],
      "where": "string",
      "invalidate_query": "string",
      "close_connection": "google.protobuf.BoolValue",
      "share_connection": "google.protobuf.BoolValue"
    },
    "clickhouse_source": {
      "db": "string",
      "table": "string",
      "host": "string",
      "port": "int64",
      "user": "string",
      "password": "string",
      "where": "string",
      "secure": "google.protobuf.BoolValue"
    },
    "mongodb_source": {
      "db": "string",
      "collection": "string",
      "host": "string",
      "port": "int64",
      "user": "string",
      "password": "string",
      "options": "string"
    },
    "postgresql_source": {
      "db": "string",
      "table": "string",
      "hosts": [
        "string"
      ],
      "port": "int64",
      "user": "string",
      "password": "string",
      "invalidate_query": "string",
      "ssl_mode": "SslMode"
    }
    // end of the list of possible fields
  },
  "update_mask": "google.protobuf.FieldMask"
}

Field

Description

cluster_id

string

Required field. ID of the ClickHouse cluster to update the external dictionary for.
To get the cluster ID, use a List request.

The maximum string length in characters is 50.

external_dictionary

ExternalDictionary

Configuration of the external dictionary.

update_mask

google.protobuf.FieldMask

Field mask that specifies which fields of the External Dictionary should be updated.

ExternalDictionaryExternalDictionary

External dictionary configuration.

Field

Description

name

string

Required field. Name of the external dictionary.

structure

Structure

Required field. Structure of the external dictionary.

layout

Layout

Required field. Layout determining how to store the dictionary in memory.

For details, see https://clickhouse.com/docs/sql-reference/dictionaries#ways-to-store-dictionaries-in-memory.

fixed_lifetime

int64

Fixed interval between dictionary updates.

Includes only one of the fields fixed_lifetime, lifetime_range.

lifetime_range

Range

Range of intervals between dictionary updates for ClickHouse to choose from.

Includes only one of the fields fixed_lifetime, lifetime_range.

http_source

HttpSource

HTTP source for the dictionary.

Includes only one of the fields http_source, mysql_source, clickhouse_source, mongodb_source, postgresql_source.

mysql_source

MysqlSource

MySQL source for the dictionary.

Includes only one of the fields http_source, mysql_source, clickhouse_source, mongodb_source, postgresql_source.

clickhouse_source

ClickhouseSource

ClickHouse source for the dictionary.

Includes only one of the fields http_source, mysql_source, clickhouse_source, mongodb_source, postgresql_source.

mongodb_source

MongodbSource

MongoDB source for the dictionary.

Includes only one of the fields http_source, mysql_source, clickhouse_source, mongodb_source, postgresql_source.

postgresql_source

PostgresqlSource

PostgreSQL source for the dictionary.

Includes only one of the fields http_source, mysql_source, clickhouse_source, mongodb_source, postgresql_source.

StructureStructure

Configuration of external dictionary structure.

Field

Description

id

Id

Single numeric key column for the dictionary.

key

Key

Composite key for the dictionary, containing of one or more key columns.

For details, see ClickHouse documentation.

range_min

Attribute

Field holding the beginning of the range for dictionaries with RANGE_HASHED layout.

For details, see ClickHouse documentation.

range_max

Attribute

Field holding the end of the range for dictionaries with RANGE_HASHED layout.

For details, see ClickHouse documentation.

attributes[]

Attribute

Description of the fields available for database queries.

For details, see ClickHouse documentation.

The number of elements must be greater than 0.

IdId

Numeric key.

Field

Description

name

string

Required field. Name of the numeric key.

KeyKey

Complex key.

Field

Description

attributes[]

Attribute

Attributes of a complex key.

The number of elements must be greater than 0.

AttributeAttribute

Field

Description

name

string

Required field. Name of the column.

type

string

Required field. Type of the column.

null_value

string

Default value for an element without data (for example, an empty string).

expression

string

Expression, describing the attribute, if applicable.

hierarchical

bool

Indication of hierarchy support.

Default value: false.

injective

bool

Indication of injective mapping "id -> attribute".

Default value: false.

LayoutLayout

Field

Description

type

enum Type

Required field. Layout type.

For details, see ClickHouse documentation.

  • FLAT: The dictionary is completely stored in memory in the form of flat arrays.
    Applicable only for dictionaries with numeric keys of the UInt64 type.
  • HASHED: The dictionary is completely stored in memory in the form of a hash table.
    Applicable only for dictionaries with numeric keys of the UInt64 type.
  • COMPLEX_KEY_HASHED: The dictionary is completely stored in memory in the form of a hash table.
    Applicable for dictionaries with composite keys of arbitrary type.
  • RANGE_HASHED: The dictionary is stored in memory in the form of a hash table with an ordered array of ranges and their corresponding values.
    Applicable only for dictionaries with numeric keys of the UInt64 type.
  • CACHE: The dictionary is stored in a cache that has a fixed number of cells. These cells contain frequently used elements.
    Applicable only for dictionaries with numeric keys of the UInt64 type.
  • COMPLEX_KEY_CACHE: The dictionary is stored in a cache that has a fixed number of cells. These cells contain frequently used elements.
    Applicable for dictionaries with composite keys of arbitrary type.
  • SPARSE_HASHED: The dictionary is completely stored in memory in the form of a hash table.
    It's similar to HASHED layout type but uses less memory in favor of more CPU usage.
    Applicable only for dictionaries with numeric keys of the UInt64 type.
  • COMPLEX_KEY_SPARSE_HASHED: The dictionary is completely stored in memory in the form of a hash table.
    It's similar to COMPLEX_KEY_HASHED layout type but uses less memory in favor of more CPU usage.
    Applicable for dictionaries with composite keys of arbitrary type.
  • COMPLEX_KEY_RANGE_HASHED: The dictionary is stored in memory in the form of a hash table with an ordered array of ranges and their corresponding values.
    Applicable for dictionaries with composite keys of arbitrary type.
  • DIRECT: The dictionary is not stored in memory and directly goes to the source during the processing of a request.
    Applicable only for dictionaries with numeric keys of the UInt64 type.
  • COMPLEX_KEY_DIRECT: The dictionary is not stored in memory and directly goes to the source during the processing of a request.
    Applicable for dictionaries with composite keys of arbitrary type.
  • IP_TRIE: The specialized layout type for mapping network prefixes (IP addresses) to metadata such as ASN.

size_in_cells

int64

Number of cells in the cache. Rounded up to a power of two.
Applicable only for CACHE and COMPLEX_KEY_CACHE layout types.

Default value: 1000000000.

For details, see ClickHouse documentation.

allow_read_expired_keys

google.protobuf.BoolValue

Allows to read expired keys.
Applicable only for CACHE and COMPLEX_KEY_CACHE layout types.

Default value: false.

For details, see ClickHouse documentation.

max_update_queue_size

int64

Max size of update queue.
Applicable only for CACHE and COMPLEX_KEY_CACHE layout types.

Default value: 100000.

For details, see ClickHouse documentation.

update_queue_push_timeout_milliseconds

int64

Max timeout in milliseconds for push update task into queue.
Applicable only for CACHE and COMPLEX_KEY_CACHE layout types.

Default value: 10.

For details, see ClickHouse documentation.

query_wait_timeout_milliseconds

int64

Max wait timeout in milliseconds for update task to complete.
Applicable only for CACHE and COMPLEX_KEY_CACHE layout types.

Default value: 60000 (1 minute).

For details, see ClickHouse documentation.

max_threads_for_updates

int64

Max threads for cache dictionary update.
Applicable only for CACHE and COMPLEX_KEY_CACHE layout types.

Default value: 4.

For details, see ClickHouse documentation.

initial_array_size

int64

Initial dictionary key size.
Applicable only for FLAT layout type.

Default value: 1024.

For details, see ClickHouse documentation.

max_array_size

int64

Maximum dictionary key size.
Applicable only for FLAT layout type.

Default value: 500000.

For details, see ClickHouse documentation.

access_to_key_from_attributes

google.protobuf.BoolValue

Allows to retrieve key attribute using dictGetString function.
Enabling this option increases memory usage.
Applicable only for IP_TRIE layout type.

For details, see ClickHouse documentation.

RangeRange

Field

Description

min

int64

Minimum dictionary lifetime.

max

int64

Maximum dictionary lifetime.

HttpSourceHttpSource

Field

Description

url

string

Required field. URL of the source dictionary available over HTTP.

format

string

Required field. The data format. Valid values are all formats supported by ClickHouse SQL dialect.

headers[]

Header

HTTP headers.

HeaderHeader

Field

Description

name

string

Required field. Header name.

value

string

Required field. Header value.

MysqlSourceMysqlSource

Field

Description

db

string

Required field. Database name.

table

string

Required field. Table name.

port

int64

Port to use when connecting to a replica of the dictionary source.

user

string

Required field. Name of the user for replicas of the dictionary source.

password

string

Password of the user for replicas of the dictionary source.

replicas[]

Replica

List of MySQL replicas of the database used as dictionary source.

where

string

Selection criteria for the data in the specified MySQL table.

invalidate_query

string

Query for checking the dictionary status, to pull only updated data.

close_connection

google.protobuf.BoolValue

Should a connection be closed after each request.

share_connection

google.protobuf.BoolValue

Should a connection be shared for some requests.

ReplicaReplica

Field

Description

host

string

Required field. MySQL host of the replica.

The maximum string length in characters is 253.

priority

int64

The priority of the replica that ClickHouse takes into account when connecting.
Replica with the highest priority should have this field set to the lowest number.

port

int64

Port to use when connecting to the replica.
If a port is not specified for a replica, ClickHouse uses the port specified for the source.

user

string

Name of the MySQL database user.
If a user is not specified for a replica, ClickHouse uses the user specified for the source.

password

string

Password of the MySQL database user.
If a password is not specified for a replica, ClickHouse uses the password specified for the source.

ClickhouseSourceClickhouseSource

Field

Description

db

string

Required field. Database name.

table

string

Required field. Table name.

host

string

ClickHouse host.

The maximum string length in characters is 253.

port

int64

Port to use when connecting to the host.

user

string

Required field. Name of the ClickHouse database user.

password

string

Password of the ClickHouse database user.

where

string

Selection criteria for the data in the specified ClickHouse table.

secure

google.protobuf.BoolValue

Determines whether to use TLS for connection.

MongodbSourceMongodbSource

Field

Description

db

string

Required field. Database name.

collection

string

Required field. Collection name.

host

string

Required field. MongoDB host.

The maximum string length in characters is 253.

port

int64

Port to use when connecting to the host.

user

string

Required field. Name of the MongoDB database user.

password

string

Password of the MongoDB database user.

options

string

Dictionary source options.

PostgresqlSourcePostgresqlSource

Field

Description

db

string

Required field. Database name.

table

string

Required field. Table name.

hosts[]

string

PostgreSQL hosts.

port

int64

Port to use when connecting to the PostgreSQL hosts.

user

string

Required field. Name of the PostrgreSQL database user.

password

string

Password of the PostrgreSQL database user.

invalidate_query

string

Query for checking the dictionary status, to pull only updated data.

ssl_mode

enum SslMode

Mode of SSL TCP/IP connection to the PostgreSQL host.

  • DISABLE: Only try a non-SSL connection.
  • ALLOW: First try a non-SSL connection; if that fails, try an SSL connection.
  • PREFER: First try an SSL connection; if that fails, try a non-SSL connection.
  • VERIFY_CA: Only try an SSL connection, and verify that the server certificate is issued by a trusted certificate authority (CA).
  • VERIFY_FULL: Only try an SSL connection, verify that the server certificate is issued by a trusted CA and that the requested server host name matches that in the certificate.

operation.Operationoperation.Operation

{
  "id": "string",
  "description": "string",
  "created_at": "google.protobuf.Timestamp",
  "created_by": "string",
  "modified_at": "google.protobuf.Timestamp",
  "done": "bool",
  "metadata": "google.protobuf.Any",
  // Includes only one of the fields `error`, `response`
  "error": "google.rpc.Status",
  "response": "google.protobuf.Any"
  // end of the list of possible fields
}

An Operation resource. For more information, see Operation.

Field

Description

id

string

ID of the operation.

description

string

Description of the operation. 0-256 characters long.

created_at

google.protobuf.Timestamp

Creation timestamp.

created_by

string

ID of the user or service account who initiated the operation.

modified_at

google.protobuf.Timestamp

The time when the Operation resource was last modified.

done

bool

If the value is false, it means the operation is still in progress.
If true, the operation is completed, and either error or response is available.

metadata

google.protobuf.Any

Service-specific metadata associated with the operation.
It typically contains the ID of the target resource that the operation is performed on.
Any method that returns a long-running operation should document the metadata type, if any.

error

google.rpc.Status

The error result of the operation in case of failure or cancellation.

Includes only one of the fields error, response.

The operation result.
If done == false and there was no failure detected, neither error nor response is set.
If done == false and there was a failure detected, error is set.
If done == true, exactly one of error or response is set.

response

google.protobuf.Any

The normal response of the operation in case of success.
If the original method returns no data on success, such as Delete,
the response is google.protobuf.Empty.
If the original method is the standard Create/Update,
the response should be the target resource of the operation.
Any method that returns a long-running operation should document the response type, if any.

Includes only one of the fields error, response.

The operation result.
If done == false and there was no failure detected, neither error nor response is set.
If done == false and there was a failure detected, error is set.
If done == true, exactly one of error or response is set.

Was the article helpful?

Previous
CreateExternalDictionary
Next
DeleteExternalDictionary
© 2026 Direct Cursus Technology L.L.C.