Copy hive table

hive -e "SET mapreduce.job.priority=VERY_HIGH; export table ${table1} to 'hdfs://<namenode>:8020/user/hdfs/<location>/${table1}';"
Once exported we have to import table from that location:
hive -e "SET mapreduce.job.priority=VERY_HIGH; import table ${table2} from '/user/hdfs/<location>' location 'hdfs://<namenode>:8020/apps/hive/warehouse';"
For cloudera change the default hive location '/apps/hive/warehouse'
0 Comments

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *