Skip to content

Latest commit

 

History

History
52 lines (46 loc) · 1 KB

EXTRACT_LOAD.MD

File metadata and controls

52 lines (46 loc) · 1 KB

Extract and Load

clickhouse-client --password
create database sakila_db
CREATE TABLE `actor` (
  `actor_id` Int64,
  `first_name` Nullable(String),
  `last_name` Nullable(String),
  `last_update` Nullable(DateTime64)
) ENGINE = MergeTree ORDER BY actor_id;
clickhouse-mysql \
    --src-host=localhost \
    --src-user=admin \
    --src-password=password \
    --migrate-table \
    --src-tables=sakila.actor \
    --dst-host=127.0.0.1 \
    --dst-password=root \
    --dst-schema sakila_db \
    --dst-table actor  
CREATE TABLE `film_actor` (
  `actor_id` Int64,
  `film_id` Int64,
  `last_update` Nullable(DateTime64)
) ENGINE = MergeTree ORDER BY (actor_id,film_id);
clickhouse-mysql \
    --src-host=localhost \
    --src-user=admin \
    --src-password=password \
    --migrate-table \
    --src-tables=sakila.film_actor \
    --dst-host=127.0.0.1 \
    --dst-password=root \
    --dst-schema sakila_db \
    --dst-table film_actor