본문으로 바로가기
본문으로 바로가기

MsgPack

InputOutputAlias

설명

ClickHouse는 MessagePack 데이터 파일을 읽고 쓰는 기능을 지원합니다.

데이터 타입 매칭

MessagePack 데이터 타입 (INSERT)ClickHouse 데이터 타입MessagePack 데이터 타입 (SELECT)
uint N, positive fixintUIntNuint N
int N, negative fixintIntNint N
boolUInt8uint 8
fixstr, str 8, str 16, str 32, bin 8, bin 16, bin 32Stringbin 8, bin 16, bin 32
fixstr, str 8, str 16, str 32, bin 8, bin 16, bin 32FixedStringbin 8, bin 16, bin 32
float 32Float32float 32
float 64Float64float 64
uint 16Dateuint 16
int 32Date32int 32
uint 32DateTimeuint 32
uint 64DateTime64uint 64
fixarray, array 16, array 32Array/Tuplefixarray, array 16, array 32
fixmap, map 16, map 32Mapfixmap, map 16, map 32
uint 32IPv4uint 32
bin 8Stringbin 8
int 8Enum8int 8
bin 8(U)Int128/(U)Int256bin 8
int 32Decimal32int 32
int 64Decimal64int 64
bin 8Decimal128/Decimal256bin 8

사용 예

".msgpk" 파일에 쓰기:

$ clickhouse-client --query="CREATE TABLE msgpack (array Array(UInt8)) ENGINE = Memory;"
$ clickhouse-client --query="INSERT INTO msgpack VALUES ([0, 1, 2, 3, 42, 253, 254, 255]), ([255, 254, 253, 42, 3, 2, 1, 0])";
$ clickhouse-client --query="SELECT * FROM msgpack FORMAT MsgPack" > tmp_msgpack.msgpk;

포맷 설정

SettingDescriptionDefault
input_format_msgpack_number_of_columns삽입된 MsgPack 데이터에 포함된 컬럼 수입니다. 데이터에서 스키마를 자동으로 추론할 때 사용됩니다.0
output_format_msgpack_uuid_representationMsgPack 포맷에서 UUID를 출력하는 방식입니다.EXT