Export ClickHouse to Local Files in JSON
Fast, parallel data export with zero intermediate storage
Terminal
.\FastBCP.exe `
--connectiontype "clickhouse" `
--server "host.domain | host.domain,port | host.domain,port/service" `
--database "tpch" `
--trusted `
--sourceschema "tpch10" `
--sourcetable "orders" `
--query "SELECT * FROM tpch10.orders" `
--directory "D:\Data\fastbcpexport\raw\{sourcedatabase}\{sourceschema}" `
--fileoutput "{sourcetable}.json" `
--decimalseparator "." `
--dateformat "yyyy-MM-dd HH:mm:ss" `
--encoding "UTF-8" `
--method "Ntile" `
--distributekeycolumn "o_orderkey" `
--paralleldegree -2 `
--merge false `
--runid "runidfromcaller"Source - ClickHouse
ClickHouse is an ultra-fast column-oriented analytics database. FastBCP leverages ClickHouse's architecture for high-performance exports.
Features:
- •Optimized for analytical queries
- •Native columnar format support
- •Exceptional performance on large volumes
Parallel Method - Ntile
Divides data into N equal partitions based on a numeric column.
Requirement: Requires a numeric distribution column
Available parallel methods with ClickHouse:
Output Format - JSON (JavaScript Object Notation)
JSON is the most widely used data exchange format on the web. FastBCP exports data to JSON Lines (NDJSON) format, with one record per line for efficient streaming.
Features:
- •JSON Lines (NDJSON) format
- •One record per line for streaming
- •UTF-8 encoding
- •Compatible with all JSON parsers
Destination - Local File System
FastBCP exports data directly to the local file system, ideal for on-premise processing, testing, or archiving.
Storage Type:
Local Disk
Features:
- •Direct write to local storage
- •No network overhead
- •Flexible path configuration
- •Perfect for development and testing