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.
@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?