hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Harris (JIRA)" <>
Subject [jira] [Created] (HIVE-2111) NullPointerException on select * with table using RegexSerDe and partitions
Date Tue, 12 Apr 2011 14:31:05 GMT
NullPointerException on select * with table using RegexSerDe and partitions

                 Key: HIVE-2111
             Project: Hive
          Issue Type: Bug
          Components: Serializers/Deserializers
    Affects Versions: 0.7.0
         Environment: Amazon Elastic Mapreduce
            Reporter: Marc Harris

When querying against a table that is partitioned, and uses RegexSerde, select with explicit
columns works, but "select *" results in a NullPointerException

To reproduce:

1) create a table containing the following text (notice the blank line):


2) copy the file to hdfs:
hadoop dfs -put foo.txt test/part1=x/foo.txt

3) run the following hive commands to create a table:

add jar s3://elasticmapreduce/samples/hive/jars/hive_contrib.jar;

drop table test;

create external table test(col1 STRING, col2 STRING) 
partitioned by (part1 STRING) 
row format serde 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe' 
with serdeproperties ( "input.regex" = "^\(.*data\)(.*data\).*$") 
stored as textfile 
location 'hdfs:///user/hadoop/test';

alter table test add partition (part1='x');

4) select from it with explicit columns:
select part1, col1, col2 from test;
x	fillerdata	fillerdata
x	fillerdata	2fillerdata

5) select from it with * columns
select * from test;

Failed with exception
11/04/12 14:28:27 ERROR CliDriver: Failed with exception java.lang.NullPointerException
	at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(
	at org.apache.hadoop.hive.ql.Driver.getResults(
	at org.apache.hadoop.hive.cli.CliDriver.processCmd(
	at org.apache.hadoop.hive.cli.CliDriver.processLineInternal(
	at org.apache.hadoop.hive.cli.CliDriver.processLine(
	at org.apache.hadoop.hive.cli.CliDriver.main(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.apache.hadoop.util.RunJar.main(
Caused by: java.lang.NullPointerException
	at java.util.ArrayList.addAll(
	at org.apache.hadoop.hive.serde2.objectinspector.UnionStructObjectInspector.getStructFieldsDataAsList(
	at org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.serialize(
	at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(
	... 10 more

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message