メインコンテンツまでスキップ
メインコンテンツまでスキップ

YTsaurus

Experimental feature. Learn more.
Not supported in ClickHouse Cloud

YTsaurus テーブルエンジンを使用すると、YTsaurus クラスターからデータをインポートできます。

テーブルの作成

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

これは実験的な機能であり、将来のリリースでは後方互換性のない方法で変更される可能性があります。 allow_experimental_ytsaurus_table_engine 設定を使用して YTsaurus テーブルエンジンの使用を有効にします。

次のように設定できます:

SET allow_experimental_ytsaurus_table_engine = 1

エンジンパラメータ

  • http_proxy_url — YTsaurus HTTP プロキシへの URL。
  • cypress_path — データソースへの Cypress パス。
  • oauth_token — OAuth トークン。

使用例

YTsaurus テーブルを作成するクエリを示します:

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

テーブルからデータを返すには、次のように実行します:

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

データ型

原始データ型

YTsaurus データ型Clickhouse データ型
int8Int8
int16Int16
int32Int32
int64Int64
uint8UInt8
uint16UInt16
uint32UInt32
uint64UInt64
floatFloat32
doubleFloat64
booleanBool
stringString
utf8String
jsonJSON
yson(type_v3)JSON
uuidUUID
date32Date(未対応)
datetime64Int64
timestamp64Int64
interval64Int64
dateDate(未対応)
datetimeDateTime
timestampDateTime64(6)
intervalUInt64
anyString
nullNothing
voidNothing
T with required = FalseNullable(T)

複合型

YTsaurus データ型Clickhouse データ型
decimalDecimal
optionalNullable
listArray
structNamedTuple
tupleTuple
variantVariant
dictArray(Tuple(...))
taggedT

関連情報