How Do I Export Data from ClickHouse to a File?
Using INTO OUTFILE Clause
Add an INTO OUTFILE clause to your query.
For example:
SELECT * FROM table INTO OUTFILE 'file'
By default, ClickHouse uses the TabSeparated format for output data. To select the data format, use the FORMAT clause.
For example:
SELECT * FROM table INTO OUTFILE 'file' FORMAT CSV
Using a File-Engine Table
See File table engine.
Using Command-Line Redirection
$ clickhouse-client --query "SELECT * from table" --format FormatName > result.txt
See clickhouse-client.
当前内容版权归 ClickHouse 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ClickHouse .