Data exchange with [EX|IM]PORT

When working on data migration or release deployment, we may need to move data between different environments or clusters. In HQL, EXPORT and IMPORT statements are available to move data between HDFS in different environments or clusters. The EXPORT statement exports both data and metadata from a table or partition. Metadata is exported in a file called _metadata. Data is exported in a subdirectory called data, as follows:

> EXPORT TABLE employee TO '/tmp/output5';No rows affected (0.19 seconds)      > dfs -ls -R /tmp/output5/;+--------------------------------+|           DFS Output           |+--------------------------------+| ... /tmp/output5/_metadata     || ... /tmp/output5/data          || ... /tmp/output5/data/000000_0 |+--------------------------------+ ...

Get Apache Hive Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.