[jira] [Created] (FLINK-16882) NPE when reading hive table with RegexSerde

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-16882) NPE when reading hive table with RegexSerde

Shang Yuanchun (Jira)
linweijiang created FLINK-16882:
-----------------------------------

             Summary: NPE when reading hive table with RegexSerde
                 Key: FLINK-16882
                 URL: https://issues.apache.org/jira/browse/FLINK-16882
             Project: Flink
          Issue Type: Bug
          Components: Connectors / Hive
    Affects Versions: 1.10.0
         Environment: 1、flink-1.10.0、hive-1.2.0

2、hive table creation syntax:

 
{code:java}
CREATE TABLE test_serde(
   c0 string COMMENT 'COMMENT-c0',
   c1 string COMMENT 'COMMENT-c1',
   c2 string COMMENT 'COMMENT-c2')
 ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
 WITH SERDEPROPERTIES (
  'input.regex' = '([^ ]*) ([^ ]*) ([^ ]*)',
  'output.format.string' = '%1$s %2$s %3$s'
 )
{code}
3、query sql:

  select * from test_serde;
            Reporter: linweijiang


When I use sql-client to read hive table with serde 'org.apache.hadoop.hive.serde2.RegexSerDe', it throws a NullPointerException:
{code:java}
org.apache.flink.connectors.hive.FlinkHiveException: Error happens when deserialize from storage file.
 at org.apache.flink.connectors.hive.read.HiveMapredSplitReader.<init>(HiveMapredSplitReader.java:131)
 at org.apache.flink.connectors.hive.read.HiveTableInputFormat.open(HiveTableInputFormat.java:121)
 at org.apache.flink.connectors.hive.read.HiveTableInputFormat.open(HiveTableInputFormat.java:56)
 at org.apache.flink.streaming.api.functions.source.InputFormatSourceFunction.run(InputFormatSourceFunction.java:85)
 at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:100)
 at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:63)
 at org.apache.flink.streaming.runtime.tasks.SourceStreamTask$LegacySourceFunctionThread.run(SourceStreamTask.java:196)
Caused by: java.lang.NullPointerException
 at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
 at com.google.common.base.Splitter.split(Splitter.java:383)
 at org.apache.hadoop.hive.serde2.RegexSerDe.initialize(RegexSerDe.java:151)
 at org.apache.hadoop.hive.serde2.AbstractSerDe.initialize(AbstractSerDe.java:53)
 at org.apache.hadoop.hive.serde2.SerDeUtils.initializeSerDe(SerDeUtils.java:521)
 at org.apache.flink.connectors.hive.read.HiveMapredSplitReader.<init>(HiveMapredSplitReader.java:127)
 ... 6 more
{code}
 



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