ogrodnek / csv-serde

Hive SerDe for CSV

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

partition by issue

jwszolek opened this issue · comments

I have a problem with adding partitions to the following HQL code.
Query below works fine, but when I try to add PARTITION BY (look second query) it dies with Null pointer exception.

CREATE EXTERNAL TABLE ingestion_csv_test
(
one string,
two string
)
ROW FORMAT SERDE 'com.bizo.hive.serde.csv.CSVSerde'
with serdeproperties (
"separatorChar" = "|"
)
LOCATION '/user/cloudera/hive-csv';

Problematic query below:

CREATE EXTERNAL TABLE ingestion_csv_test
(
one string,
two string
)
PARTITIONED BY (ingestion_dt STRING)
ROW FORMAT SERDE 'com.bizo.hive.serde.csv.CSVSerde'
with serdeproperties (
"separatorChar" = "|"
)

Exception:

hive> alter table ingestion_csv_test add partition (ingestion_dt = '2016-01-01') location '/user/cloudera/hive-csv';
OK
Time taken: 0.093 seconds

hive> select * from ingestion_csv_test;

FAILED: RuntimeException org.apache.hadoop.hive.ql.metadata.HiveException: Failed with exception nulljava.lang.NullPointerException
at org.apache.hadoop.hive.ql.exec.FetchOperator.needConversion(FetchOperator.java:607)
at org.apache.hadoop.hive.ql.exec.FetchOperator.setupOutputObjectInspector(FetchOperator.java:578)
at org.apache.hadoop.hive.ql.exec.FetchOperator.initialize(FetchOperator.java:172)
at org.apache.hadoop.hive.ql.exec.FetchOperator.(FetchOperator.java:140)
at org.apache.hadoop.hive.ql.exec.FetchTask.initialize(FetchTask.java:79)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:453)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:307)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1110)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1158)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1047)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1037)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:207)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:159)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:370)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:756)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

any ideas why?