Hive: Fast concatenate two tables into one?

concatenation, hadoop, hive

Solution

If you are trying to merge `table_A` and `table_b` into a single one, the easiest way is to use the `UNION ALL` operator. You can find the syntax and use cases here - https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Union

Problem

I have two Hive tables of the same structure (schema). What would be an efficient SQL request to concatenate them into a single table with the same structure? Update, this works quite fast in my case: CREATE TABLE xy AS SELECT * FROM ( SELECT * FROM x UNION ALL SELECT * FROM y ) tmp;

Original source