HDFS, HIVE

HIVE Data-Copy – Import/Export

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s