foreword
- This article applies to ClickHouse 22.3
- Official document: Inserting Data from a File , which is to put the data file path directly into
SQL
, it is useless to redirect
JSON format
export statement
clickhouse-client -h 127.0.0.1 --port 9000 -u default --password XXX -d mylog \ --query "SELECT * from mylog.mylog" --format JSONEachRow > 2021.big_json
import statement
clickhouse-client -h 127.0.0.1 --port 9000 -u default --password XXX -d mylog \ --query "INSERT INTO mylog.mylog FORMAT JSONEachRow" < 2021.big_json
Native format
export statement
clickhouse-client -h 127.0.0.1 --port 9000 -u default --password XXX -d mylog \ --query "SELECT * from mylog.mylog" --format Native > 2021.native
import statement
clickhouse-client -h 127.0.0.1 --port 9000 -u default --password XXX -d mylog \ --query "INSERT INTO mylog.mylog FORMAT Native" < 2021.native
This article is from qbit snap
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。