[jira] [Created] (HIVE-20098) NPE when getting Date column statistics

2018-07-05 Thread Andy Rosa (JIRA)
Andy Rosa created HIVE-20098:


 Summary: NPE when getting Date column statistics
 Key: HIVE-20098
 URL: https://issues.apache.org/jira/browse/HIVE-20098
 Project: Hive
  Issue Type: Bug
  Components: Metastore, Standalone Metastore
Affects Versions: 1.2.1, 4.0.0
 Environment: Tested on versions `1.2.1` and the latest 4.0.0-SNAPSHOT
Reporter: Andy Rosa


The issue reproduces only for a date column for a partitioned table. It 
reproduces only if the date column has all the values set to null, and if the 
partition is not empty.

Here is a quick reproducer:

 

 
{code:java}
CREATE TABLE dummy_table (
c_date DATE,
c_bigint BIGINT
)
PARTITIONED BY (ds STRING);

INSERT OVERWRITE TABLE dummy_table PARTITION (ds='2018-01-01') SELECT CAST(null 
AS DATE), CAST(null AS BIGINT) FROM ;

ANALYZE TABLE dummy_table COMPUTE STATISTICS FOR COLUMNS;

DESCRIBE FORMATTED dummy_table.c_bigint PARTITION (ds='2018-01-01');
DESCRIBE FORMATTED dummy_table.c_date PARTITION (ds='2018-01-01');
{code}
 

 

The first `DESCRIBE FORMATTED` statement succeeds, when the second fails with 
an `NPE`

 

It happens because the null check is missing when converting Object from the 
ObjectStore to the Thrift object. The null check is missing only in the date 
statistics conversion for the partitioned table. 

Missing: 
[https://github.com/apache/hive/blob/master/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java#L469]

Present: 
[https://github.com/apache/hive/blob/master/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java#L558]

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (HIVE-19798) Number of distinct values column statistic accounts null as a distinct value

2018-06-05 Thread Andy Rosa (JIRA)
Andy Rosa created HIVE-19798:


 Summary: Number of distinct values column statistic accounts null 
as a distinct value
 Key: HIVE-19798
 URL: https://issues.apache.org/jira/browse/HIVE-19798
 Project: Hive
  Issue Type: Bug
  Components: Metastore
Affects Versions: 1.2.1
Reporter: Andy Rosa






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (HIVE-13289) LazyBinaryColumnarSerDe: 0 length VARCHAR values are serialized as NULL

2016-03-15 Thread Andy Rosa (JIRA)
Andy Rosa created HIVE-13289:


 Summary: LazyBinaryColumnarSerDe: 0 length VARCHAR values are 
serialized as NULL
 Key: HIVE-13289
 URL: https://issues.apache.org/jira/browse/HIVE-13289
 Project: Hive
  Issue Type: Bug
  Components: Serializers/Deserializers
Affects Versions: 0.13.1, 0.12.0, 2.1.0
Reporter: Andy Rosa


On the moment of implementation LazyBinaryColumnarSerDe Hive didn't have the 
VARCHAR type implemented. Serializing empty strings is implemented by writing 
INVALID_UTF__SINGLE_BYTE 
(https://github.com/apache/hive/commit/a266556f2bcf249af110035af1006e52f42046af#diff-aa353060bea2a72013021093b7e8a21cR86).
 During the implementation of the VARCHAR type this place was probably missed, 
and the VARCHAR type hadn't been added to that IF.



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