I have a table A in cluster X.
I want to perform some HQL (say select * from A where A.country = 'INDIA'
) & save output in table B in cluster Y.
I can perform HQL on table A & store data in table temp. Then, export this hive table to table B in cluster Y using:
EXPORT TABLE temp TO 'path/to/hdfs_clusterX';
hadoop distcp hdfs:///path/to/hdfs_clusterX hdfs:///path/to/hdfs_clusterY
IMPORT TABLE Y FROM 'path/to/another/hdfs
Is there any other better way rather than creating this table temp?