Back to Clickhouse

YTsaurus table engine

docs/en/engines/table-engines/integrations/ytsaurus.md

26.4.1.1-new3.8 KB
Original Source

import CloudNotSupportedBadge from '@theme/badges/CloudNotSupportedBadge'; import ExperimentalBadge from '@theme/badges/ExperimentalBadge';

YTsaurus table engine

<ExperimentalBadge/> <CloudNotSupportedBadge/>

The YTsaurus table engine allows you to import data from a YTsaurus cluster.

Creating a table {#creating-a-table}

sql
    CREATE TABLE [IF NOT EXISTS] [db.]table_name
    (
        name1 [type1],
        name2 [type2], ...
    ) ENGINE = YTsaurus('http_proxy_url', 'cypress_path', 'oauth_token')

:::info This is an experimental feature that may change in backwards-incompatible ways in future releases. Enable usage of the YTsaurus table engine using setting allow_experimental_ytsaurus_table_engine.

You can do so using:

SET allow_experimental_ytsaurus_table_engine = 1. :::

Engine parameters

  • http_proxy_url — URL to the YTsaurus http proxy.
  • cypress_path — Cypress path to the data source.
  • oauth_token — OAuth token.

Usage example {#usage-example}

Shows a query creating the YTsaurus table:

sql
SHOW CREATE TABLE yt_saurus;
sql
CREATE TABLE yt_saurus
(
    `a` UInt32,
    `b` String
)
ENGINE = YTsaurus('http://localhost:8000', '//tmp/table', 'password')

To return the data from the table, run:

sql
SELECT * FROM yt_saurus;
response
 ┌──a─┬─b──┐
 │ 10 │ 20 │
 └────┴────┘

Data types {#data-types}

Primitive data types {#primitive-data-types}

YTsaurus data typeClickhouse data type
int8Int8
int16Int16
int32Int32
int64Int64
uint8UInt8
uint16UInt16
uint32UInt32
uint64UInt64
floatFloat32
doubleFloat64
booleanBool
stringString
utf8String
jsonJSON
yson(type_v3)JSON
uuidUUID
date32Date(Not supported yet)
datetime64Int64
timestamp64Int64
interval64Int64
dateDate(Not supported yet)
datetimeDateTime
timestampDateTime64(6)
intervalUInt64
anyString
nullNothing
voidNothing
T with required = FalseNullable(T)

Composite types {#composite-data-types}

YTsaurus data typeClickhouse data type
decimalDecimal
optionalNullable
listArray
structNamedTuple
tupleTuple
variantVariant
dict`Array(Tuple(...))
taggedT

See Also