HiveException: java.lang.NullPointerException: cache

376 views
Skip to first unread message

Pawan Goyal

unread,
Apr 10, 2018, 7:21:39 AM4/10/18
to Druid Development
Hi,

I am trying to ingest data into druid using Hive.

When I run below query, it gets the result.

select
 from_utc_timestamp(unix_timestamp(get_json_object(wikiJson, '$.time'), "yyyy-MM-dd'T'HH:mm:ss"), 'UTC') `__time`,
 get_json_object(wikiJson, '$.channel') `channel`,
 get_json_object(wikiJson, '$.added') `added`
from
 Wiki_json;


but running below query

CREATE TABLE druid_table_1 STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler' TBLPROPERTIES ("druid.datasource" = "wikiticker_hive", "druid.segment.granularity" = "DAY") AS

select
 from_utc_timestamp(unix_timestamp(get_json_object(wikiJson, '$.time'), "yyyy-MM-dd'T'HH:mm:ss"), 'UTC') `__time`,
 get_json_object(wikiJson, '$.channel') `channel`,
 get_json_object(wikiJson, '$.added') `added`
from
 Wiki_json;


I get the error

Error: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row (tag=0) {"key":{"__time_granularity":"1970-01-17 00:00:00"},"value":{"_col0":"1970-01-17 22:04:42.599","_col1":"#en.wikipedia","_col2":"182"}}

at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.reduce(ExecReducer.java:257)

at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:445)

at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:393)

at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:174)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:422)

at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1962)

at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:168)

Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row (tag=0) {"key":{"__time_granularity":"1970-01-17 00:00:00"},"value":{"_col0":"1970-01-17 22:04:42.599","_col1":"#en.wikipedia","_col2":"182"}}

at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.reduce(ExecReducer.java:245)

... 7 more

Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NullPointerException: cache

at org.apache.hadoop.hive.ql.exec.FileSinkOperator.createBucketFiles(FileSinkOperator.java:574)

at org.apache.hadoop.hive.ql.exec.FileSinkOperator.process(FileSinkOperator.java:674)

at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:897)

at org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:95)

at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.reduce(ExecReducer.java:236)

... 7 more

Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NullPointerException: cache

at org.apache.hadoop.hive.ql.io.HiveFileFormatUtils.getHiveRecordWriter(HiveFileFormatUtils.java:274)

at org.apache.hadoop.hive.ql.exec.FileSinkOperator.createBucketForFileIdx(FileSinkOperator.java:619)

at org.apache.hadoop.hive.ql.exec.FileSinkOperator.createBucketFiles(FileSinkOperator.java:563)

... 11 more

Caused by: java.lang.NullPointerException: cache

at org.apache.hive.druid.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:229)

at org.apache.hive.druid.io.druid.segment.realtime.appenderator.AppenderatorImpl.<init>(AppenderatorImpl.java:146)

at org.apache.hive.druid.io.druid.segment.realtime.appenderator.Appenderators.createOffline(Appenderators.java:84)

at org.apache.hadoop.hive.druid.io.DruidRecordWriter.<init>(DruidRecordWriter.java:106)

at org.apache.hadoop.hive.druid.io.DruidOutputFormat.getHiveRecordWriter(DruidOutputFormat.java:222)

at org.apache.hadoop.hive.ql.io.HiveFileFormatUtils.getRecordWriter(HiveFileFormatUtils.java:286)

at org.apache.hadoop.hive.ql.io.HiveFileFormatUtils.getHiveRecordWriter(HiveFileFormatUtils.java:271)

... 13 more


Please help.



Gian Merlino

unread,
May 3, 2018, 3:04:38 PM5/3/18
to druid-de...@googlegroups.com
Hi Pawan,

This would be a better question for the Hive community.

Gian

--
You received this message because you are subscribed to the Google Groups "Druid Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to druid-development+unsubscribe@googlegroups.com.
To post to this group, send email to druid-development@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-development/b0287058-ffbb-403b-8724-e64ffcd9151e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages