3

The jar file for druid hive handler is there. Clients table is already there in hive with data. Filename in hive library folder hive-druid-handler-3.1.2.jar.

I am getting the error an when I try to create table in hive for druid

FAILED: SemanticException Cannot find class 'org.apache.hadoop.hive.druid.DruidStorageHandler'

Here is the SQL.

CREATE TABLE ssb_druid_hive
STORED BY 'org.apache.hadoop.hive.
druid.DruidStorageHandler'
TBLPROPERTIES (
"druid.segment.granularity" = "MONTH",
"druid.query.granularity" = "DAY")
AS
SELECT
cast(clients.first_name  as int) first_name ,
cast(clients.last_name  as int) last_name  
from clients

what could be the reason ?

leftjoin
  • 36,950
  • 8
  • 57
  • 116
Vishnu
  • 93
  • 1
  • 5

2 Answers2

0

I found some people having the similar problem and here's the Link to the external forum

In conclusion, you may have to reinstall the latest version of the file for it to work.

i.e. download the latest version of Hive. If you have downloaded Hive1, download Hive2 and it would work.

Here's a pdf format of the webpage (just in case that one is dropped): https://drive.google.com/file/d/1-LgtgJa6FPgULeG09qbFNIYA2EgUCJK9/view?usp=sharing

  • 1
    While the contents of the link you provided might answer the question, it is better to include the essential parts of the answer in your post and provide the link for reference, since link only answers can become invalid if the linked page changes. – Patrick Klein Nov 20 '20 at 19:30
0

I faced same issue while creating external table on hive.
We need to add hive-druid-handler-3.1.2.jar jar to your hive server.

  • To add this temporarily,
    1. Download hive-druid-handler-3.1.2.jar from here
    2. Copy .jar to s3 or blob
    3. Goto hive CLI and type add jars s3://your-bucket/hive-druid-handler-3.1.2.jar
  • To add Permanently
    1. Copy hive-druid-handler-3.1.2.jar into hive lib folder.
    hdfs dfs -copyToLocal s3://your-bucket/hive-druid-handler-3.1.2.jar /usr/hdp/4.1.4.8/hive/lib/
    2. Restart hive server
Ganesh
  • 677
  • 8
  • 11