Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Create table in Hive with DruidStorageHadler fails

Highlighted

Create table in Hive with DruidStorageHadler fails

Explorer

I'm trying to create a table in hive with DruidStorageHandler as follows:

CREATE TABLE druid_table (`__time` timestamp,`userid`string,`num_l`float)STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'TBLPROPERTIES ("druid.segment.granularity"="DAY");

It fails with the following error:

Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: java.io.FileNotFoundException: File /tmp/workingDirectory/.staging-hive_20180507130925_227f2e48-d049-464e-b2cd-43009b3398b3/segmentsDescriptorDir does not exist. (state=08S01,code=1)

I went through the Source code of DruidStorageHandler.Java and to my surprise I wasn't able to see any dfs.mkdir call for the above "segmentsDescriptorDir" directory.

I have got this syntax straight from the documentation.

CREATE TABLE druid_table_1
(`__time` TIMESTAMP, `dimension1` STRING, `dimension2` STRING, `metric1` INT, `metric2` FLOAT)
STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler';
Has someone faced a similar problem earlier? Thanks in Advance.

Megh

3 REPLIES 3
Highlighted

Re: Create table in Hive with DruidStorageHadler fails

Expert Contributor

This is a fixed bug looks like you older version fix is here https://issues.apache.org/jira/browse/HIVE-16677

The workaround is to use a CTAS insert at least one row.

Highlighted

Re: Create table in Hive with DruidStorageHadler fails

Explorer

Re: Create table in Hive with DruidStorageHadler fails

Explorer

@Slim Thanks for your response. The version of Druid that we are using is 0.9.2 which is available as technical preview with HDP 2.6.1. As per your solution I was able to use CTAS successfully. However, I'm not able to append data in the table.

insert into table poc_druid.druid_table select * from poc.test;

This command fails with the following error.

Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:INSERT INTO statement is not allowed by druid storage handler) (state=08S01,code=1)

The documentation says that INSERT statements are supported. Am I missing something here?

Many Thanks.

Don't have an account?
Coming from Hortonworks? Activate your account here