You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

  • Exchange Partition

It is proposed as part of https://issues.apache.org/jira/browse/HIVE-4095. Once this is implemented, it should be part of the Language Manual DDL.
The idea is similar to this.

The high level idea is as follows:

alter table <tablename> exchange partition (<(partial)?partition spec>) with table <tablename> partition (<(partial)?partition spec>)

The semantics of the above statement is that the data between the above partitions are switched. Both the tables should have the same schema. The operation fails in the presence of an index. Consider the following examples:

 

create table T1(a string, b string) partitioned by (ds string, hr string);
create table T2(a string, b string) partitioned by (ds string, hr string);

  • No labels