YTsaurus 테이블 엔진을 사용하면 YTsaurus 클러스터에서 데이터를 가져올 수 있습니다.
테이블 생성
CREATE TABLE [IF NOT EXISTS] [db.]table_name
(
name1 [type1],
name2 [type2], ...
) ENGINE = YTsaurus('http_proxy_url', 'cypress_path', 'oauth_token')엔진 매개변수
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 데이터 타입 |
|---|---|
int8 |
Int8 |
int16 |
Int16 |
int32 |
Int32 |
int64 |
Int64 |
uint8 |
UInt8 |
uint16 |
UInt16 |
uint32 |
UInt32 |
uint64 |
UInt64 |
float |
Float32 |
double |
Float64 |
boolean |
Bool |
string |
String |
utf8 |
String |
json |
JSON |
yson(type_v3) |
JSON |
uuid |
UUID |
date32 |
Date(아직 지원되지 않음) |
datetime64 |
Int64 |
timestamp64 |
Int64 |
interval64 |
Int64 |
date |
Date(아직 지원되지 않음) |
datetime |
DateTime |
timestamp |
DateTime64(6) |
interval |
UInt64 |
any |
String |
null |
Nothing |
void |
Nothing |
T with required = False |
Nullable(T) |
복합 타입
| YTsaurus 데이터 타입 | ClickHouse 데이터 타입 |
|---|---|
decimal |
Decimal |
optional |
Nullable |
list |
Array |
struct |
NamedTuple |
tuple |
Tuple |
variant |
Variant |
dict |
`Array(Tuple(…)) |
tagged |
T |
관련 항목