hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashutosh Chauhan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-18975) NPE when inserting NULL value in structure and array with HBase table
Date Fri, 16 Mar 2018 18:15:00 GMT

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

Ashutosh Chauhan commented on HIVE-18975:
-----------------------------------------

+1 pending test.

> NPE when inserting NULL value in structure and array with HBase table
> ---------------------------------------------------------------------
>
>                 Key: HIVE-18975
>                 URL: https://issues.apache.org/jira/browse/HIVE-18975
>             Project: Hive
>          Issue Type: Bug
>          Components: HBase Handler
>            Reporter: Oleksiy Sayankin
>            Assignee: Oleksiy Sayankin
>            Priority: Major
>             Fix For: 3.0.0
>
>         Attachments: HIVE-18975.1.patch
>
>
> STR (Structure)
> *STEP 1. Create tables*
> {code}
> CREATE TABLE IF NOT EXISTS t1 (id INT);
> INSERT INTO TABLE t1 VALUES (1),(2),(3),(4),(5);
> CREATE TABLE IF NOT EXISTS `htable`(
>   `id` INT, 
>   `map_column` STRUCT<s_int:INT,s_string:STRING,s_date:DATE>) ROW FORMAT SERDE
'org.apache.hadoop.hive.hbase.HBaseSerDe'  STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
 WITH SERDEPROPERTIES (   'hbase.columns.mapping'=':key,id:id',    'serialization.format'='1')
TBLPROPERTIES ( 'hbase.table.name'='tmp/h');
> {code}
> *STEP 2. Insert into table stored in HBase the struct with NULL value in it*
> {code}
> INSERT INTO `htable` SELECT 2,NAMED_STRUCT("s_int",CAST(NULL AS INT),"s_string","s1","s_date",CAST('2018-03-12'
AS DATE)) FROM t1 LIMIT 1;
> {code}
> *ACTUAL RESULT*
> The query fails with NPE.
> {code}
> Diagnostic Messages for this Task:
> Error: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException:
Hive Runtime Error while processing row (tag=0) {"key":{},"value":{"_col0":2,"_col1":{"s_int":null,"s_string":"s1","s_date":"2018-03-12"}}}
> 	at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.reduce(ExecReducer.java:257)
> 	at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:444)
> 	at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:392)
> 	at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at javax.security.auth.Subject.doAs(Subject.java:422)
> 	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1631)
> 	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
> Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while
processing row (tag=0) {"key":{},"value":{"_col0":2,"_col1":{"s_int":null,"s_string":"s1","s_date":"2018-03-12"}}}
> 	at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.reduce(ExecReducer.java:245)
> 	... 7 more
> Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.serde2.SerDeException:
java.lang.NullPointerException
> 	at org.apache.hadoop.hive.ql.exec.FileSinkOperator.process(FileSinkOperator.java:787)
> 	at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:879)
> 	at org.apache.hadoop.hive.ql.exec.LimitOperator.process(LimitOperator.java:63)
> 	at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:879)
> 	at org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:95)
> 	at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.reduce(ExecReducer.java:236)
> 	... 7 more
> Caused by: org.apache.hadoop.hive.serde2.SerDeException: java.lang.NullPointerException
> 	at org.apache.hadoop.hive.hbase.HBaseSerDe.serialize(HBaseSerDe.java:301)
> 	at org.apache.hadoop.hive.ql.exec.FileSinkOperator.process(FileSinkOperator.java:714)
> 	... 12 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableIntObjectInspector.get(WritableIntObjectInspector.java:36)
> 	at org.apache.hadoop.hive.serde2.lazy.LazyUtils.writePrimitiveUTF8(LazyUtils.java:239)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serialize(HBaseRowSerializer.java:236)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serialize(HBaseRowSerializer.java:295)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serialize(HBaseRowSerializer.java:222)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serializeField(HBaseRowSerializer.java:194)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serialize(HBaseRowSerializer.java:118)
> 	at org.apache.hadoop.hive.hbase.HBaseSerDe.serialize(HBaseSerDe.java:297)
> 	... 13 more
> {code}
> *EXPECTED RESULT*
> The query finished successfully.
> STR (arrays)
> *STEP 1. Create tables*
> {code}
> CREATE TABLE hbase_list(id INT, list_column array<string>) ROW FORMAT SERDE 'org.apache.hadoop.hive.hbase.HBaseSerDe'
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ('hbase.columns.mapping'=':key,id:id',
'serialization.format'='1') TBLPROPERTIES ( 'hbase.table.name'='tmp/htest');
> {code}
> *STEP 2. Insert into table stored in HBase the array with NULL value in it*
> {code}
> insert into hbase_list SELECT 2, array("a", CAST (NULL AS STRING),  "b") FROM t1 LIMIT
1;
> {code}
> *ACTUAL RESULT*
> The query fails with NPE.
> {code}
> Diagnostic Messages for this Task:
> Error: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException:
Hive Runtime Error while processing row (tag=0) {"key":{},"value":{"_col0":2,"_col1":["a",null,"b"]}}
> 	at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.reduce(ExecReducer.java:257)
> 	at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:444)
> 	at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:392)
> 	at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at javax.security.auth.Subject.doAs(Subject.java:422)
> 	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1631)
> 	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
> Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while
processing row (tag=0) {"key":{},"value":{"_col0":2,"_col1":["a",null,"b"]}}
> 	at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.reduce(ExecReducer.java:245)
> 	... 7 more
> Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.serde2.SerDeException:
java.lang.NullPointerException
> 	at org.apache.hadoop.hive.ql.exec.FileSinkOperator.process(FileSinkOperator.java:787)
> 	at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:879)
> 	at org.apache.hadoop.hive.ql.exec.LimitOperator.process(LimitOperator.java:63)
> 	at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:879)
> 	at org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:95)
> 	at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.reduce(ExecReducer.java:236)
> 	... 7 more
> Caused by: org.apache.hadoop.hive.serde2.SerDeException: java.lang.NullPointerException
> 	at org.apache.hadoop.hive.hbase.HBaseSerDe.serialize(HBaseSerDe.java:301)
> 	at org.apache.hadoop.hive.ql.exec.FileSinkOperator.process(FileSinkOperator.java:714)
> 	... 12 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.hadoop.hive.serde2.lazy.LazyUtils.writePrimitiveUTF8(LazyUtils.java:260)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serialize(HBaseRowSerializer.java:236)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serialize(HBaseRowSerializer.java:251)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serialize(HBaseRowSerializer.java:222)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serializeField(HBaseRowSerializer.java:194)
> 	at org.apache.hadoop.hive.hbase.HBaseRowSerializer.serialize(HBaseRowSerializer.java:118)
> 	at org.apache.hadoop.hive.hbase.HBaseSerDe.serialize(HBaseSerDe.java:297)
> 	... 13 more
> {code}
> *EXPECTED RESULT*
> The query finished successfully.



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

Mime
View raw message