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

Aditya Shah commented on HIVE-23804:
------------------------------------

[~ngangam] some details on the exact issue:

Env:
Hive version : 2.3 + hs2 + Tez
Metastore Db version: 3.1.2

query:
{code:java}
analyze table testTbl compute statistics for columns col1,col3;{code}

Stack trace:
{code:java}
Caused by: org.apache.hadoop.hive.metastore.api.MetaException: Insert of object 
"org.apache.hadoop.hive.metastore.model.MTableColumnStatistics@e5ef653" using 
statement "INSERT INTO `TAB_COL_STATS` 
(`CS_ID`,`AVG_COL_LEN`,`COLUMN_NAME`,`COLUMN_TYPE`,`DB_NAME`,`BIG_DECIMAL_HIGH_VALUE`,`BIG_DECIMAL_LOW_VALUE`,`DOUBLE_HIGH_VALUE`,`DOUBLE_LOW_VALUE`,`LAST_ANALYZED`,`LONG_HIGH_VALUE`,`LONG_LOW_VALUE`,`MAX_COL_LEN`,`NUM_DISTINCTS`,`NUM_FALSES`,`NUM_NULLS`,`NUM_TRUES`,`TBL_ID`,`TABLE_NAME`)
 VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" failed : Field 'CAT_NAME' 
doesn't have a default value
 at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$set_aggr_stats_for_result$set_aggr_stats_for_resultStandardScheme.read(ThriftHiveMetastore.java)
 ~[hive-exec-2.3.4-qubole.jar:2.3.4-qubole]
 at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$set_aggr_stats_for_result$set_aggr_stats_for_resultStandardScheme.read(ThriftHiveMetastore.java)
 ~[hive-exec-2.3.4-qubole.jar:2.3.4-qubole]
 at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$set_aggr_stats_for_result.read(ThriftHiveMetastore.java)
 ~[hive-exec-2.3.4-qubole.jar:2.3.4-qubole]
 at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:86) 
~[hive-exec-2.3.4-qubole.jar:2.3.4-qubole]
 at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_set_aggr_stats_for(ThriftHiveMetastore.java:3559)
 ~[hive-exec-2.3.4-qubole.jar:2.3.4-qubole]
 at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.set_aggr_stats_for(ThriftHiveMetastore.java:3546)
 ~[hive-exec-2.3.4-qubole.jar:2.3.4-qubole]
 at 
org.apache.hadoop.hive.metastore.HiveMetaStoreClient.setPartitionColumnStatistics(HiveMetaStoreClient.java:1692)
 ~[hive-exec-2.3.4-qubole.jar:2.3.4-qubole]
 at 
org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.setPartitionColumnStatistics(SessionHiveMetaStoreClient.java:355)
 ~[hive-exec-2.3.4-qubole.jar:2.3.4-qubole]{code}

Ignore the line numbers as it is an internal build in Qubole. But, there are no 
code changes in this path from OSS. 

Thanks,

Aditya

> Adding defaults for Columns Stats table in the schema to make them backward 
> compatible
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-23804
>                 URL: https://issues.apache.org/jira/browse/HIVE-23804
>             Project: Hive
>          Issue Type: Sub-task
>    Affects Versions: 2.1.1, 2.3.7
>            Reporter: Aditya Shah
>            Assignee: Aditya Shah
>            Priority: Major
>         Attachments: HIVE-23804-1.patch, HIVE-23804.patch
>
>
> Since the table/part column statistics tables have added a new `CAT_NAME` 
> column with `NOT NULL` constraint in version >3.0.0, queries to analyze 
> statistics break for Hive versions <3.0.0 when used against an upgraded DB. 
> One such miss is handled in HIVE-21739.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to