CREATE SOURCE orders_rw
WITH (
connector = 'iceberg',
warehouse.path = 's3a://my-iceberg-bucket/path/to/warehouse,
s3.endpoint = 'https://s3.ap-southeast-1.amazonaws.com',
s3.access.key = '${ACCESS_KEY}',
s3.secret.key = '${SECRET_KEY},
catalog.name='demo',
database.name='dev',
table.name='table'
);
CREATE SINK clickhouse_sink AS
SELECT
order_status,
COUNT(*) as order_count,
SUM(total_amount) as total_revenue,
AVG(total_amount) as avg_order_value,
MIN(last_updated) as first_order_time,
MAX(last_updated) as last_order_time
FROM orders_rw
WITH (
connector = 'clickhouse',
type = 'append-only',
clickhouse.url = 'clickhouse://localhost:8123',
clickhouse.user = 'clickhouse_demo',
clickhouse.password = 'demoPass123!',
clickhouse.database = 'default',
clickhouse.table='demo_test'
);