Move data and schema from Snowflake to ClickHouse with staged files, CREATE TABLE, and INSERT INTO SELECT.
Cut storage costs, achieve sub-second analytics, and keep full SQL support by off-loading historical or high-volume tables to ClickHouse.
1) Export Snowflake tables to external storage (S3/GCS). 2) Generate compatible DDL for ClickHouse. 3) Load files into ClickHouse. 4) Validate row counts and query results.
Use COPY INTO @stage
to write compressed Parquet files to cloud storage.Partition large tables by date to enable parallel loads.
COPY INTO @mystage/orders FROM Orders FILE_FORMAT=(TYPE=PARQUET COMPRESSION=SNAPPY);
Translate Snowflake data types to ClickHouse types.Generate DDL with ORDER BY
and PRIMARY KEY
for query speed.
CREATE TABLE Orders (id UInt64, customer_id UInt64, order_date Date, total_amount Decimal(12,2)) ENGINE = MergeTree() ORDER BY (order_date,id);
Point ClickHouse at the export bucket with s3
table function or use clickhouse-client --query
piping.
INSERT INTO Orders SELECT * FROM s3('https://bucket/orders/*.parquet', 'aws_key', 'aws_secret', 'Parquet');
Compare counts and sample aggregates: SELECT count(*) FROM Orders
.Cross-check totals with Snowflake to catch truncation or type mismatch.
Open-source clickhouse-migrator, Airbyte, and dbt can orchestrate export, DDL generation, and load retries.
• Compress Parquet files
• Use 64–128 MB file size for balanced parallelism
• Set max_partitions_per_insert_block
in ClickHouse to avoid small parts
Schedule hourly incremental exports using Snowflake streams and load them with ClickHouse Kafka engine or simple cron jobs.
Retain Snowflake for critical workloads until ClickHouse has passed acceptance tests.Enable dual-write in ETL pipelines for a grace period.
Use column compression codecs, increase max_threads
, and align ORDER BY
keys with common filters such as order_date
.
If you need ANSI compliant transactions, native time-travel, or automatic clustering without manual tuning, Snowflake may still fit better.
.
Yes. Use COPY INTO LOCAL FILE
in Snowflake, then clickhouse-client --query
piping local Parquet files.
Store them as ClickHouse JSON
or flatten during export using Snowflake’s SELECT variant:field::type
pattern.
Yes. Capture changes with Snowflake Streams, export incrementals, and ingest them via ClickHouse Materialized Views
or Kafka.