Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.

On this page

Show all

Help Center/ MapReduce Service/ Component Operation Guide (Normal)/ Using ClickHouse/ ClickHouse FAQ/ How Do I Migrate Data from Hive/HDFS to ClickHouse?

How Do I Migrate Data from Hive/HDFS to ClickHouse?

Updated on 2024-12-11 GMT+08:00

Question

How do I migrate Hive/HDFS data to ClickHouse?

Answer

You can export data from Hive as CSV files and import the CSV files to ClickHouse.

  1. Export data from Hive as CSV files.

    hive -e "select * from db_hive.student limit 1000"| tr "\t" "," > /data/bigdata/hive/student.csv;

  2. Import the CSV files to the student_hive table in the default database of ClickHouse. There can be security risks if a command contains the authentication password. You are advised to disable the command recording function (history) before running the command.

    clickhouse --client --port 9002 --password xxx -m --query='INSERT INTO default.student_hive FORMAT CSV' < /data/bigdata/hive/student.csv

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback