Uploaded image for project: 'Apache Trafodion'
  1. Apache Trafodion
  2. TRAFODION-3152

UPDATE STATISTICS ... CREATE SAMPLE failure on Hive table

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: sql-cmp
    • Labels:
      None

      Description

      On a fresh Trafodion instance where the "HIVESTATS" schema does not yet exist, if one does an UPDATE STATISTICS ... CREATE SAMPLE (or REMOVE SAMPLE) on a Hive table, it fails with an ugly error, as the following example shows:

      >>get schemas;

       

      Schemas in Catalog TRAFODION

      ============================

       

      SEABASE

      LIBMGR

      MD

      PRIVMGR_MD

      REPOS

       

      — SQL operation complete.

      >>update statistics for table hive.hive.customer create sample random 10 percent;

       

          • ERROR[4082] Object TRAFODION."HIVESTATS".SB_PERSISTENT_SAMPLES does not exist or is inaccessible.

       

          • ERROR[1003] Schema TRAFODION.HIVESTATS does not exist.

       

          • ERROR[8839] Transaction was aborted.

       

          • ERROR[9200] UPDATE STATISTICS for table HIVE.HIVE.CUSTOMER encountered an error (8609) from statement Process_Query.

       

          • ERROR[8609] Waited rollback performed without starting a transaction.

       

      — SQL operation failed with errors.

      >>update statistics for table hive.hive.customer remove sample;

       

          • ERROR[4082] Object TRAFODION."HIVESTATS".SB_PERSISTENT_SAMPLES does not exist or is inaccessible.

       

          • ERROR[1003] Schema TRAFODION.HIVESTATS does not exist.

       

          • ERROR[8839] Transaction was aborted.

       

          • ERROR[9200] UPDATE STATISTICS for table HIVE.HIVE.CUSTOMER encountered an error (8609) from statement Process_Query.

       

          • ERROR[8609] Waited rollback performed without starting a transaction.

       

      — SQL operation failed with errors.

      There is a simple work-around. Just perform a normal UPDATE STATISTICS on any Hive table, then Trafodion will create the "HIVESTATS" schema under the covers. Alternatively, perform a REGISTER command for any Hive table; again Trafodion will create "HIVESTATS" under the covers. The CREATE SAMPLE / REMOVE SAMPLE commands will now work.

      To reproduce, you need a fresh Trafodion instance (e.g. created using INITIALIZE TRAFODION).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dbirdsall Dave Birdsall
                Reporter:
                dbirdsall Dave Birdsall
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: