[ https://issues.apache.org/jira/browse/HIVE-18946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16414679#comment-16414679 ]
Ashutosh Chauhan commented on HIVE-18946: ----------------------------------------- What we want is if both old and new data is null, max/min = null, if one is null and other is not, then max/min = non-null value , if both are non-null compare it and use appropriately. > Fix columnstats merge NPE > ------------------------- > > Key: HIVE-18946 > URL: https://issues.apache.org/jira/browse/HIVE-18946 > Project: Hive > Issue Type: Sub-task > Reporter: Zoltan Haindrich > Assignee: Laszlo Bodor > Priority: Major > Attachments: HIVE-18946.01.patch > > > after analyzing an empty table may lead to an NPE when inserting into it... > {code} > 2018-03-13T06:54:22,503 ERROR [df3fb505-e0bc-4595-a874-b735dab8dff6 main] > metastore.RetryingHMSHandler: java.lang.NullPointerException > at > org.apache.hadoop.hive.metastore.api.Decimal.compareTo(Decimal.java:318) > at > org.apache.hadoop.hive.metastore.columnstats.merge.DecimalColumnStatsMerger.merge(DecimalColumnStatsMerger.java:35) > at > org.apache.hadoop.hive.metastore.utils.MetaStoreUtils.mergeColStats(MetaStoreUtils.java:778) > at > org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.set_aggr_stats_for(HiveMetaStore.java:6934) > 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:498) > at > org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:147) > at > org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:108) > at com.sun.proxy.$Proxy55.set_aggr_stats_for(Unknown Source) > [...] > {code} > reproduce > {code} > set hive.stats.autogather=true; > set hive.explain.user=true; > drop table if exists testdeci2; > create table testdeci2( > id int, > amount decimal(10,3), > sales_tax decimal(10,3), > item string) > stored as orc location '/tmp/testdeci2' > TBLPROPERTIES ("transactional"="false") > ; > analyze table testdeci2 compute statistics for columns; > insert into table testdeci2 > values(1,12.123,12345.123,'desk1'),(2,123.123,1234.123,'desk2'); > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)