1

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:

Hive not getting linked here

Would be really helpful if anyone can please suggest how to overcome this scenario.

pbraeutigm
  • 455
  • 4
  • 8
Fierymech
  • 11
  • 3
  • Hi All, Bumping this thread. Can anyone please help in this regard? I'm kind of stuck here. Please advise. – Fierymech Jul 06 '23 at 03:14

0 Answers0