[ 
https://issues.apache.org/jira/browse/HIVE-15353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15718515#comment-15718515
 ] 

Anthony Hsu commented on HIVE-15353:
------------------------------------

Example stack trace:
{noformat}
2016-12-02T14:25:36,994 ERROR [pool-6-thread-6] metastore.RetryingHMSHandler: 
MetaException(message:java.lang.NullPointerException)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newMetaException(HiveMetaStore.java:6152)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.rename_partition(HiveMetaStore.java:3828)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.rename_partition(HiveMetaStore.java:3765)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.alter_partition(HiveMetaStore.java:3748)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at 
org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:140)
        at 
org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:99)
        at com.sun.proxy.$Proxy21.alter_partition(Unknown Source)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$alter_partition.getResult(ThriftHiveMetastore.java:12394)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$alter_partition.getResult(ThriftHiveMetastore.java:12378)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
        at 
org.apache.hadoop.hive.metastore.TUGIBasedProcessor.process(TUGIBasedProcessor.java:103)
        at 
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
        at 
org.apache.hadoop.hive.metastore.MetaStoreUtils.areSameColumns(MetaStoreUtils.java:629)
        at 
org.apache.hadoop.hive.metastore.HiveAlterHandler.updatePartColumnStats(HiveAlterHandler.java:770)
        at 
org.apache.hadoop.hive.metastore.HiveAlterHandler.alterPartition(HiveAlterHandler.java:405)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.rename_partition(HiveMetaStore.java:3799)
        ... 17 more
{noformat}

> Metastore throws NPE if StorageDescriptor.cols is null
> ------------------------------------------------------
>
>                 Key: HIVE-15353
>                 URL: https://issues.apache.org/jira/browse/HIVE-15353
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 2.2.0
>            Reporter: Anthony Hsu
>            Assignee: Anthony Hsu
>
> When using the HiveMetaStoreClient API directly to talk to the metastore, you 
> get NullPointerExceptions when StorageDescriptor.cols is null in the 
> Table/Partition object in the following calls:
> * create_table
> * alter_table
> * alter_partition
> Calling add_partition with StorageDescriptor.cols set to null causes null to 
> be stored in the metastore database and subsequent calls to alter_partition 
> for that partition to fail with an NPE.
> The simplest way to fix these NPEs seems to be to update the 
> StorageDescriptor.cols Thrift definition and set a default value of empty 
> list. Some null checks will also have to be added to handle existing nulls in 
> the metastore database.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to