Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-7973 Hive Replication Support
  3. HIVE-10228

Changes to Hive Export/Import/DropTable/DropPartition to support replication semantics

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.0
    • 1.2.0
    • Import/Export
    • None

    Description

      We need to update a couple of hive commands to support replication semantics. To wit, we need the following:

      EXPORT ... [FOR [METADATA] REPLICATION(“comment”)]

      Export will now support an extra optional clause to tell it that this export is being prepared for the purpose of replication. There is also an additional optional clause here, that allows for the export to be a metadata-only export, to handle cases of capturing the diff for alter statements, for example.

      Also, if done for replication, the non-presence of a table, or a table being a view/offline table/non-native table is not considered an error, and instead, will result in a successful no-op.

      IMPORT ... (as normal) – but handles new semantics

      No syntax changes for import, but import will have to change to be able to handle all the permutations of export dumps possible. Also, import will have to ensure that it should update the object only if the update being imported is not older than the state of the object. Also, import currently does not work with dbname.tablename kind of specification, this should be fixed to work.

      DROP TABLE ... FOR REPLICATION('eventid')

      Drop Table now has an additional clause, to specify that this drop table is being done for replication purposes, and that the dop should not actually drop the table if the table is newer than that event id specified.

      ALTER TABLE ... DROP PARTITION (...) FOR REPLICATION('eventid')

      Similarly, Drop Partition also has an equivalent change to Drop Table.

      =

      In addition, we introduce a new property "repl.last.id", which when tagged on to table properties or partition properties on a replication-destination, holds the effective "state identifier" of the object.

      Attachments

        1. HIVE-10228.patch
          150 kB
          Sushanth Sowmyan
        2. HIVE-10228.2.patch
          150 kB
          Sushanth Sowmyan
        3. HIVE-10228.3.patch
          150 kB
          Sushanth Sowmyan
        4. HIVE-10228.4.patch
          151 kB
          Sushanth Sowmyan
        5. HIVE-10228.5.patch
          154 kB
          Sushanth Sowmyan

        Issue Links

          Activity

            People

              sushanth Sushanth Sowmyan
              sushanth Sushanth Sowmyan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: