1
votes

I have tried using:

Database.connection("jdbc:hive2://remote_hive:10000/db_name").driver(???).user("admin").password("admin_password")

which driver should i use to connect to hive?

Does anyone know if there is some source of API documentation? Or does anyone knows of a better way then using dry run to debug?

the best link i could find is https://docs.datastax.com/en/latest-dse/datastax_enterprise/graph/dgl/dglJDBC.html

I simply don't know what should i check....

1
What do you mean by "hive"? Apache Hive, or something else??? Because the JDBC URL for connecting to Apache Hive clearly doesn't start with jdbc:h2 - Samson Scharfrichter
you right i meant hive, though don't know which driver should i supply. i tried "org.apache.hadoop.hive.jdbc.HiveDriver" but it does not work. guess that if this its the solution i need to put the jar file of the drivers somewhere on the server - user1997656

1 Answers

0
votes

You have several possible JDBC drivers for Hive, but I doubt any of these is packaged with Cassandra...

  • the reference is the Apache driver, of course (documented here), but it has some issues: does not fully support the JDBC API (as explained in that post); exists in two flavors, one "scattered" (has dependencies on several other hive-*.jar libs etc. etc.-- see post link above) and one so-called "standalone" (which still has dependencies on several hadoop-*.jar and Apache utils); has version compatibility issues i.e. the driver version must be equal or older than the HiveServer2 version
  • a nice alternative is the Cloudera driver which is based on the Simba SDK (details in post link above); but remember that it is designed for Cloudera distros, so it may not be aligned with the latest Apache release (and it may have bugs of its own)
  • there is also the DataDirect driver that is bundled in a lot of commercial BI tools (from Oracle, IBM, MicroStrategy, etc) with an OEM license; but apart from the cost$ issue, last time I checked, it did not cover all Hive connectivity options (maybe they bridged the gap now?)

First step: download one or more JDBC driver(s).

Second step: "make friends" with the driver(s) -- i.e. check out the CLASSPATH issues, URL syntax issues, etc -- with a JDBC utility such as DBVisualizer (see post link above, once again).

Third step: profit!