Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-23074

SchemaTool sql script execution errors when updating the metadata's schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 3.1.2
    • None
    • SQL
    • running machine: centos7.2 

      metadata db: PostgreSQL 11.3 on x86_64-pc-linux-gnu

      hive version: upgrade from version 3.0.0 to 3.1.2

    • add "IF NOT EXISTS" for create & "IF EXISTS" for drop to keep consistency in the sql script

    Description

      SchemaTool sql script executed with conflicts on indices and columns and missed " for avoiding keywords when updating the metadata's schema

      bin/schematool -dbType postgres -upgradeSchemaFrom 3.0.0

      went like this:

      ALTER TABLE "GLOBAL_PRIVS" ADD COLUMN "AUTHORIZER" character varying(128) DEFAULT NULL::character varying
      Error: ERROR: column "AUTHORIZER" of relation "GLOBAL_PRIVS" already exists (state=42701,code=0)
      ALTER TABLE COMPLETED_TXN_COMPONENTS ADD COLUMN IF NOT EXISTS CTC_UPDATE_DELETE char(1) NULL
      Error: ERROR: relation "completed_txn_components" does not exist (state=42P01,code=0)
      

      I've already come up with a solution and created a pull request for this issue.

      Attachments

        Issue Links

          Activity

            People

              John1Tang John1Tang
              John1Tang John1Tang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h