I have data stored in postgreSQL as data source and I want to load dimensions and fact tables of the clickhouse datawarehouse , I am new to clickhouse and used to use traditional integration tools like Talend and Microsoft SSIS to perform ETL (PS i'm using docker images for both clickhouse and postgreSQL)
Here is an example of how to import your PostgreSQL data into a new ClickHouse table of the same shape. Let's assume you have a single table named foo
with two columns, id
and foo
.
CREATE TABLE IF NOT EXISTS foo_pg
(
id UUID,
foo String
) ENGINE = PostgreSQL('host:port', 'database', 'tablename', 'username', 'password');
INSERT
):CREATE TABLE IF NOT EXISTS foo
(
id UUID,
foo String
) ENGINE = MergeTree()
ORDER BY tuple()
PRIMARY KEY(id);
INSERT INTO foo (id, foo)
SELECT id, foo FROM foo_pg;