Hello,
I'm getting java.lang.NullPointerException(null) when try to query columns
from an empty table (hive is running on Amazon Elastic MapReduce).
Here is the reproduction:
hive> CREATE EXTERNAL TABLE t1 (
request string
)
PARTITIONED BY (source STRING)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '9'
LOCATION 's3://bucket-name/exception/'
;
hive> select * from t1;
OK
Time taken: 0.078 seconds
hive> select request from t1;
Total MapReduce jobs = 1
Number of reduce tasks is set to 0 since there's no reduce operator
Job Submission failed with exception 'java.lang.NullPointerException(null)'
FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.ExecDriver
Trying the same queries on an unpartitioned table works:
hive> drop table t1;
OK
hive> CREATE EXTERNAL TABLE t1 (request string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '9'
LOCATION 's3://bucket-name/exception/';
OK
hive> select * from t1;
OK
hive> select request from t1;
Total MapReduce jobs = 1
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_201006061250_0038, Tracking URL =
http://ip-10-242-230-112.ec2.internal:9100/jobdetails.jsp?jobid=job_201006061250_0038
Kill Command = /home/hadoop/.versions/0.18/bin/../bin/hadoop job
-Dmapred.job.tracker=ip-10-242-230-112.ec2.internal:9001 -kill
job_201006061250_0038
2010-06-06 07:39:59,006 map = 0%, reduce =0%
2010-06-06 07:40:04,048 map = 100%, reduce =100%
Ended Job = job_201006061250_0038
OK
Can I tune something to make hive not NPE on empty tables or should I open a
bug report?
Thank you,
Maxim.