HIVE Data Copy:

 

With hive one better option to copy the Hive data and metadata from cluster A to cluster B is to use HIVE Import/Export

 

NOTE:  In HIVE CLI exporting the data directly to target cluster will work fine as the Path can be resolved, But Beeline won’t allow copying the data directly to the target cluster directly. To do via beeline, Export table to the local HDFS and copy the data to the target cluster and connect to target hiveServer 2 and call the import to import the data.

 

  • EXPORT TABLE tablename [PARTITION (part_column=”value”[, …])]

TO ‘export_target_path’ [ FOR replication(‘eventid’) ]

 

  • IMPORT [[EXTERNAL] TABLE new_or_original_tablename [PARTITION (part_column=”value”[, …])]]

FROM ‘source_path’

[LOCATION ‘import_target_path’]

 

 

Reference:

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+ImportExport

Advertisements