I am trying to connect to Hive using the DatabaseConnector but unable to do so in R within CDSW. Can anyone please suggest how to accomplish this?
Please note that when using the driver and url, I am able to connect with hive and query the same successfully. Its just that when I am using the DatabaseConnector::createConnectionDetails() function, I am unable to query hive.
Manual Working method to link Hive below:
driver <- JDBC("org.apache.hive.jdbc.HiveDriver","/path/to/CDH/Parcels/HiveJar", identifier.quote="`")
url <- "jdbc:hive2://HiveServerDetails:PORT/DBName;principal=hive/_HOST@domain.com;serviceDiscoveryMode=zookeeper;ssl=true;zookeeperNamespace=hiveserver2"
conn <- dbConnect(driver,url)
show_databases <- dbGetQuery(conn, "show databases")
show_databases
Not working method based on above using DatabaseConnector:
connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = "hive", user="", password = "", server = "jdbc:hive2://HiveServerDetails:PORT/DBName;principal=hive/_HOST@domain.com;serviceDiscoveryMode=zookeeper;ssl=true;zookeeperNamespace=hiveserver2", port = "PORT", pathToDriver="/jdbcdrivers")
Gives me the below error:
Would be really helpful if anyone can please suggest how to overcome this scenario.