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

Table-creation fails through HCatClient for Oracle-based metastore.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.14.0
    • 0.14.0
    • HCatalog, Metastore
    • None

    Description

      When tables are created using HCatClient.createTable(), if the HCatTable's creation-comment is an empty string, the table creation fails spectacularly, with this guttural utterance:

      Exception in thread "main" org.apache.hive.hcatalog.common.HCatException : 9001 : Exception occurred while processing HCat request : MetaException while creating table.. Cause : MetaException(message:java.lang.NullPointerException: Null values not allowed in persistent maps.)
              at org.apache.hive.hcatalog.api.HCatClientHMSImpl.createTable(HCatClientHMSImpl.java:185)
              at net.myth.HiveClient.main(HiveClient.java:67)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:601)
              at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
      Caused by: MetaException(message:java.lang.NullPointerException: Null values not allowed in persistent maps.)
              at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_result$create_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:22138)
              at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_result$create_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:22106)
              at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_result.read(ThriftHiveMetastore.java:22032)
              at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
              at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_create_table_with_environment_context(ThriftHiveMetastore.java:797)
              at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.create_table_with_environment_context(ThriftHiveMetastore.java:783)
              at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:487)
              at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:476)
              at org.apache.hive.hcatalog.api.HCatClientHMSImpl.createTable(HCatClientHMSImpl.java:175)
      

      This manifests with an Oracle backend, because an empty comment-string is stored in the table-properties map as a null-string. I've a patch that fixes this.

      Attachments

        1. HIVE-7891.1.patch
          0.6 kB
          Mithun Radhakrishnan

        Activity

          People

            mithun Mithun Radhakrishnan
            mithun Mithun Radhakrishnan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: