From 2c0f320fe74eabf75d1c417c0f44d6918cddbf5c Mon Sep 17 00:00:00 2001 From: adevyatova Date: Mon, 13 Sep 2021 07:54:45 +0000 Subject: [PATCH] Example --- docs/en/interfaces/formats.md | 8 +++++--- docs/ru/interfaces/formats.md | 8 +++++--- docs/tmp_msgpac_test_all_types.msgpk | Bin 200 -> 0 bytes docs/tmp_msgpack.msgpk | Bin 0 -> 24 bytes 4 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 docs/tmp_msgpac_test_all_types.msgpk create mode 100644 docs/tmp_msgpack.msgpk diff --git a/docs/en/interfaces/formats.md b/docs/en/interfaces/formats.md index 32170b4aec7..4c86c8f3c39 100644 --- a/docs/en/interfaces/formats.md +++ b/docs/en/interfaces/formats.md @@ -1567,8 +1567,10 @@ ClickHouse supports reading and writing [MessagePack](https://msgpack.org/) data Example: +Writing to a file ".msgpk": + ```sql -CREATE TABLE msgpack (uint8 UInt8, uint16 UInt16, uint32 UInt32, uint64 UInt64, int8 Int8, int16 Int16, int32 Int32, int64 Int64, float Float32, double Float64, string String, date Date, datetime DateTime, datetime64 DateTime64, array Array(UInt32)) ENGINE = Memory; -INSERT INTO msgpack VALUES (255, 65535, 4294967295, 100000000000, -128, -32768, -2147483648, -100000000000, 2.02, 10000.0000001, 'String', 18980, 1639872000, 1639872000000, [1,2,3,4,5]), (4, 1234, 3244467295, 500000000000, -1, -256, -14741221, -7000000000, 100.1, 14321.032141201, 'Another string', 20000, 1839882000, 1639872891123, [5,4,3,2,1]),(42, 42, 42, 42, 42, 42, 42, 42, 42.42, 42.42, '42', 42, 42, 42, [42]); -SELECT * FROM msgpack INTO OUTFILE 'tmp_msgpac_test_all_types.msgpk' FORMAT MsgPack; +$ 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; ``` \ No newline at end of file diff --git a/docs/ru/interfaces/formats.md b/docs/ru/interfaces/formats.md index ea57b3ded13..ce014997034 100644 --- a/docs/ru/interfaces/formats.md +++ b/docs/ru/interfaces/formats.md @@ -1481,8 +1481,10 @@ ClickHouse поддерживает запись и чтение из файло Пример: +Запись в файл ".msgpk": + ```sql -CREATE TABLE msgpack (uint8 UInt8, uint16 UInt16, uint32 UInt32, uint64 UInt64, int8 Int8, int16 Int16, int32 Int32, int64 Int64, float Float32, double Float64, string String, date Date, datetime DateTime, datetime64 DateTime64, array Array(UInt32)) ENGINE = Memory; -INSERT INTO msgpack VALUES (255, 65535, 4294967295, 100000000000, -128, -32768, -2147483648, -100000000000, 2.02, 10000.0000001, 'String', 18980, 1639872000, 1639872000000, [1,2,3,4,5]), (4, 1234, 3244467295, 500000000000, -1, -256, -14741221, -7000000000, 100.1, 14321.032141201, 'Another string', 20000, 1839882000, 1639872891123, [5,4,3,2,1]),(42, 42, 42, 42, 42, 42, 42, 42, 42.42, 42.42, '42', 42, 42, 42, [42]); -SELECT * FROM msgpack INTO OUTFILE 'tmp_msgpac_test_all_types.msgpk' FORMAT MsgPack; +$ 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; ``` \ No newline at end of file diff --git a/docs/tmp_msgpac_test_all_types.msgpk b/docs/tmp_msgpac_test_all_types.msgpk deleted file mode 100644 index efefdf32a55f96112d8952e725c2023f9687cde3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 200 zcmX@}|Lp(&=l%o1c?JdsagVYW3>O+MHZWXj0CFz_g$*9;swCwUf}BZ jJe8G&nTb&g3Qjp`t`j-!;A(oPKStx*A`>H^_(UxL8(vuZ diff --git a/docs/tmp_msgpack.msgpk b/docs/tmp_msgpack.msgpk new file mode 100644 index 0000000000000000000000000000000000000000..294ca9e3b4a3e666d2c23156faf421d8de4995e3 GIT binary patch literal 24 fcmbQiz{td`b>{Dxe`o&BIP)J!{ncV-Vq^dSnlcPc literal 0 HcmV?d00001