Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-18685 Add catalogs to Hive
  3. HIVE-21739

Make metastore DB backward compatible with pre-catalog versions of hive.

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 2.1.1
    • Fix Version/s: 4.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Since the addition of foreign key constraint between Database ('DBS') table and catalogs ('CTLGS') table in HIVE-18755 we are unable to run a simple create database command with an older version of Metastore Server. This is due to older versions having JDO schema as per older schema of 'DBS' which did not have an additional 'CTLG_NAME' column.

      The error is as follows: 

      org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Exception thrown flushing changes to datastore)
      ....
      java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails ("metastore_1238"."DBS", CONSTRAINT "CTLG_FK1" FOREIGN KEY ("CTLG_NAME") REFERENCES "CTLGS" ("NAME"))
      

        Attachments

        1. HIVE-21739.patch
          6 kB
          Aditya Shah
        2. HIVE-21739.4.patch
          28 kB
          Aditya Shah
        3. HIVE-21739.3.patch
          26 kB
          Aditya Shah
        4. HIVE-21739.2.patch
          24 kB
          Aditya Shah
        5. HIVE-21739.1.patch
          6 kB
          Aditya Shah

          Activity

            People

            • Assignee:
              aditya-shah Aditya Shah
              Reporter:
              aditya-shah Aditya Shah
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: