You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Kryvenko Igor (JIRA)" <ji...@apache.org> on 2018/03/15 20:48:00 UTC
[jira] [Created] (HIVE-18969) Hive throws NPE when writing struct
and list types data to a HBase backed table
Kryvenko Igor created HIVE-18969:
------------------------------------
Summary: Hive throws NPE when writing struct and list types data to a HBase backed table
Key: HIVE-18969
URL: https://issues.apache.org/jira/browse/HIVE-18969
Project: Hive
Issue Type: Bug
Reporter: Kryvenko Igor
Assignee: Kryvenko Igor
"INSERT INTO" query fails with NPE when we inserting STRUCT datatype with null values into a table stored in Hbase. The same issue for MAP datatype is already resolved in https://issues.apache.org/jira/browse/HIVE-13065
*Steps to reproduce*
*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}
*2. Insert into table stored 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}
The mapreduce job for insert query fails. Error messages are as below:
{code}
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.serde2.SerDeException: java.lan$
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.tez.ReduceRecordSource$GroupIterator.next(ReduceRecordSource.java:348)
... 17 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)
... 22 more
Caused by: java.lang.NullPointerException
at org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableIntObjectInspector.get(WritableIntObject$
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)
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)