ClickHouse

ClickHouse é um sistema de gerenciamento de banco de dados open-source orientado a colunas para processamento analítico online (OLAP). Ele foi feito para velocidade em escala — executando agregações e consultas analíticas sobre bilhões de linhas em tempo real.

O bloco ClickHouse conecta-se a qualquer implantação do ClickHouse (ClickHouse Cloud ou self-hosted) pela interface HTTP. Use-o para executar consultas analíticas, inserir linhas em tabelas, gerenciar schemas, inspecionar o estado do sistema e executar SQL arbitrário — tudo de dentro de um fluxo de trabalho.

Detalhes da conexão

  • Host — o hostname do seu ClickHouse (ex.: your-instance.clickhouse.cloud ou o endereço do servidor).
  • Port — a porta da interface HTTP. Use 8443 para HTTPS (ClickHouse Cloud) ou 8123 para HTTP simples (self-hosted).
  • Database / Username — usam default se não forem especificados.
  • Password — opcional para instâncias locais sem autenticação.
  • Use HTTPS — mantenha habilitado para qualquer instância remota ou Cloud.

Pontos importantes

  • UPDATE e DELETE são implementados como mutations do ClickHouse (ALTER TABLE ... UPDATE/DELETE). As mutations rodam de forma assíncrona em segundo plano, então a contagem de linhas afetadas não é retornada imediatamente.
  • O ClickHouse é otimizado para inserts em lote. Prefira agrupar muitas linhas por insert em vez de muitos inserts de uma linha.
  • O host da conexão é validado para bloquear endereços privados/internos, então o bloco não consegue acessar localhost nem hosts apenas internos.

Usage Instructions

Integrate ClickHouse into the workflow. Query and insert data, manage databases and tables, inspect schemas, monitor mutations and running queries, manage partitions, and execute raw SQL over the ClickHouse HTTP interface.

Actions

clickhouse_query

Execute a SELECT query on a ClickHouse database

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
querystringYesSQL SELECT query to execute

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

clickhouse_execute

Execute raw SQL (DDL, mutations, or queries) on a ClickHouse database

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
querystringYesRaw SQL statement to execute

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the statement
rowCountnumberNumber of rows returned or affected

clickhouse_insert

Insert a row into a ClickHouse table

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name to insert data into
dataobjectYesData object to insert (key-value pairs mapping column names to values)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayInserted rows (empty for ClickHouse inserts)
rowCountnumberNumber of rows inserted

clickhouse_insert_rows

Insert multiple rows into a ClickHouse table

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable to insert into
rowsjsonYesArray of row objects to insert, e.g. [{"id":1,"name":"a"},{"id":2,"name":"b"}]

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayInserted rows (empty for ClickHouse inserts)
rowCountnumberNumber of rows inserted

clickhouse_update

Update rows in a ClickHouse table via an ALTER TABLE ... UPDATE mutation

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name to update data in
dataobjectYesData object with fields to update (key-value pairs)
wherestringYesWHERE clause condition (without the WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayUpdated rows (empty for ClickHouse mutations)
rowCountnumberNumber of rows written by the mutation

clickhouse_delete

Delete rows from a ClickHouse table via an ALTER TABLE ... DELETE mutation

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name to delete data from
wherestringYesWHERE clause condition (without the WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayDeleted rows (empty for ClickHouse mutations)
rowCountnumberNumber of rows affected by the mutation

clickhouse_list_databases

List all databases on a ClickHouse server

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayList of databases with engine and comment
rowCountnumberNumber of rows returned

clickhouse_list_tables

List tables in the connected ClickHouse database

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

clickhouse_describe_table

Describe the columns of a ClickHouse table

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name to describe

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

clickhouse_show_create_table

Get the CREATE TABLE statement (DDL) for a ClickHouse table

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name to get the CREATE statement for

Output

ParameterTypeDescription
messagestringOperation status message
ddlstringThe CREATE TABLE statement

clickhouse_count_rows

Count rows in a ClickHouse table, optionally filtered

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name to count rows in
wherestringNoOptional WHERE clause condition without the WHERE keyword

Output

ParameterTypeDescription
messagestringOperation status message
countnumberNumber of rows

clickhouse_introspect

Introspect a ClickHouse database to retrieve table structures, columns, and engines

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to introspect
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)

Output

ParameterTypeDescription
messagestringOperation status message
tablesarrayArray of table schemas with columns and engines
namestringTable name
databasestringDatabase the table belongs to
enginestringTable engine (e.g., MergeTree, Log)
totalRowsnumberApproximate total number of rows in the table
columnsarrayTable columns
namestringColumn name
typestringClickHouse data type (e.g., UInt32, String, DateTime)
defaultKindstringKind of default expression (DEFAULT, MATERIALIZED, ALIAS)
defaultExpressionstringDefault value expression for the column
isInPrimaryKeybooleanWhether the column is part of the primary key
isInSortingKeybooleanWhether the column is part of the sorting key

clickhouse_create_database

Create a new database on a ClickHouse server

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
namestringYesName of the database to create

Output

ParameterTypeDescription
messagestringOperation status message

clickhouse_drop_database

Drop a database from a ClickHouse server

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
namestringYesName of the database to drop

Output

ParameterTypeDescription
messagestringOperation status message

clickhouse_create_table

Create a new MergeTree-family table in ClickHouse

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesName of the table to create
columnsjsonYesArray of column definitions, each an object with name and type, e.g. [{"name":"id","type":"UInt64"},{"name":"ts","type":"DateTime"}]
enginestringNoTable engine (default MergeTree)
orderBystringYesORDER BY expression, e.g. "id" or "(id, ts)"
partitionBystringNoOptional PARTITION BY expression, e.g. toYYYYMM(ts)

Output

ParameterTypeDescription
messagestringOperation status message

clickhouse_drop_table

Drop a table from a ClickHouse database

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name to drop

Output

ParameterTypeDescription
messagestringOperation status message

clickhouse_truncate_table

Remove all rows from a ClickHouse table

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name to truncate

Output

ParameterTypeDescription
messagestringOperation status message

clickhouse_rename_table

Rename a ClickHouse table

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesCurrent table name
newTablestringYesNew table name

Output

ParameterTypeDescription
messagestringOperation status message

clickhouse_optimize_table

Trigger a merge of table parts via OPTIMIZE TABLE

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable to optimize
finalbooleanNoForce a merge to a single part using FINAL

Output

ParameterTypeDescription
messagestringOperation status message

clickhouse_list_partitions

List active partitions for a ClickHouse table

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name to inspect partitions for

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

clickhouse_drop_partition

Drop a partition from a ClickHouse table

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringYesTable name
partitionstringYesPartition expression, e.g. '2024-01' or 202401

Output

ParameterTypeDescription
messagestringOperation status message

clickhouse_list_mutations

List mutations (async ALTER UPDATE/DELETE) for the connected database

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringNoOptional table name to filter mutations
onlyRunningbooleanNoOnly show mutations that are still running

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of mutation rows
rowCountnumberNumber of rows returned

clickhouse_list_running_queries

List currently running queries on a ClickHouse server

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

clickhouse_kill_query

Kill a running query by its query ID

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
queryIdstringYesThe query_id of the running query to kill

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayKill status rows
rowCountnumberNumber of rows returned

clickhouse_table_stats

Get row counts and on-disk size for tables in the connected database

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)
tablestringNoOptional table name to get stats for

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of table stats rows
rowCountnumberNumber of rows returned

clickhouse_list_clusters

List configured clusters, shards, and replicas

Input

ParameterTypeRequiredDescription
hoststringYesClickHouse server hostname (e.g., your-instance.clickhouse.cloud)
portnumberYesClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP)
databasestringYesDatabase name to connect to
usernamestringYesClickHouse username
passwordstringNoClickHouse password
securebooleanNoUse a secure HTTPS connection (default: true)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of cluster node rows
rowCountnumberNumber of rows returned

On this page