Hive
  1. Hive
  2. HIVE-6133

Support partial partition exchange

    Details

    • Type: Improvement Improvement
    • Status: Patch Available
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Query Processor
    • Labels:
      None

      Description

      Current alter exchange coerces source and destination table to have same partition columns. But source table has sub-set of partitions and provided partition spec supplements to be a complete partition spec, it need not to be that.

      For example, table into partition

      CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING);
      CREATE TABLE exchange_part_test2 (f1 string) 
      ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
      

      or

      partial partitions into parent partition

      CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING, hr STRING);
      CREATE TABLE exchange_part_test2 (f1 string) PARTITIONED BY (hr STRING)
      ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
      

      can be possible.

        Issue Links

          Activity

          Lefty Leverenz made changes -
          Link This issue is related to HIVE-4095 [ HIVE-4095 ]
          Navis made changes -
          Description Current alter exchange coerces source and destination table to have same partition columns. But source table has sub-set of partitions and provided partition spec supplements to be a complete partition spec, it need not to be that.

          For example,
          {noformat}
          CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING);
          CREATE TABLE exchange_part_test2 (f1 string)
          ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
          {noformat}

          or

          {noformat}
          CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING, hr STRING);
          CREATE TABLE exchange_part_test2 (f1 string) PARTITIONED BY (hr STRING)
          ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
          {noformat}

          can be possible.
          Current alter exchange coerces source and destination table to have same partition columns. But source table has sub-set of partitions and provided partition spec supplements to be a complete partition spec, it need not to be that.

          For example, table into partition
          {noformat}
          CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING);
          CREATE TABLE exchange_part_test2 (f1 string)
          ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
          {noformat}

          or

          partial partitions into parent partition
          {noformat}
          CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING, hr STRING);
          CREATE TABLE exchange_part_test2 (f1 string) PARTITIONED BY (hr STRING)
          ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
          {noformat}

          can be possible.
          Navis made changes -
          Remote Link This issue links to "review board (Web Link)" [ 14779 ]
          Navis made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Navis made changes -
          Attachment HIVE-6133.1.patch.txt [ 12638030 ]
          Navis made changes -
          Link This issue is blocked by HIVE-6129 [ HIVE-6129 ]
          Navis made changes -
          Field Original Value New Value
          Description Current alter exchange coerces source and destination table to have same partition columns. But source table has sub-set of partitions and provided partition spec supplements to be a complete partition spec, it need not to be that.

          For example,
          {nofomat}
          CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING);
          CREATE TABLE exchange_part_test2 (f1 string)
          ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
          {nofomat}

          or

          {nofomat}
          CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING, hr STRING);
          CREATE TABLE exchange_part_test2 (f1 string) PARTITIONED BY (hr STRING)
          ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
          {nofomat}

          can be possible.
          Current alter exchange coerces source and destination table to have same partition columns. But source table has sub-set of partitions and provided partition spec supplements to be a complete partition spec, it need not to be that.

          For example,
          {noformat}
          CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING);
          CREATE TABLE exchange_part_test2 (f1 string)
          ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
          {noformat}

          or

          {noformat}
          CREATE TABLE exchange_part_test1 (f1 string) PARTITIONED BY (ds STRING, hr STRING);
          CREATE TABLE exchange_part_test2 (f1 string) PARTITIONED BY (hr STRING)
          ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2;
          {noformat}

          can be possible.
          Navis created issue -

            People

            • Assignee:
              Navis
              Reporter:
              Navis
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development