1

I'm trying to get LibreOffice's Base v5.1.4.2, running on Ubuntu v16.04 to connect to a Hive v1.2.1 database via JDBC. I added the following jars, downloaded from Maven Central, to LibreOffice's classpath ('Tools -> LibreOffice -> Advanced -> Class Path'):

hive-common-1.2.1.jar
hive-jdbc-1.2.1.jar
hive-metastore-1.2.1.jar
hive-service-1.2.1.jar
hadoop-common-2.6.2.jar
httpclient-4.4.jar
httpcore-4.4.jar
libthrift-0.9.2.jar
commons-logging-1.1.3.jar
slf4j-api-1.7.5.jar

I then restarted LibreOffice, opened Base, selected 'Connect to an existing database' -> 'JDBC' and set the following properties:

enter image description here

I entered the credentials and clicked the 'Test Connection' button, which returned a "the connection was established successfully" message. Great!

In the LibreOffice Base UI, the options under the 'Tables' panel were grayed out. The options in the queries tab were not, so I tried to connect to Hive.

enter image description here

The 'Use Wizard to Create Query' option prompts for a password and then returns "The field names from 'airline.on_time_performance' could not be retrieved."

field names could not be retrieved

The JDBC connection is able to connect to Hive and list the tables, though it seems to have problems retrieving the columns. When I try to execute a simple select statement, the 'Create Query in SQL View' option returns a somewhat cryptic "Method not supported" message:

method not supported

The error message is a bit vague. I suspect that I may be missing a dependency since I am able to connect to Hive from Java using JDBC.

I'm curious to know if anyone in the community has LibreOffice Base working with Hive. If so, what am I missing?

Alex Woolford
  • 4,433
  • 11
  • 47
  • 80
  • You're dozens of versions of the JDBC driver out of date here. I found 2.5.4 with not much trouble. Probably the one you're using is obsolete w.r.t. the Java JDBC version. Update. – user207421 Jul 11 '16 at 06:48
  • Given the error "field names ... could not be retrieved" that version of the JDBC driver did not have support for `DatabaseMetaData.getColumns`. – Mark Rotteveel Jul 11 '16 at 10:42

1 Answers1

1

The Apache JDBC driver reports "Method not supported" for most features, just because the Apache committers did not bother to handle the list of simple yes/no API calls. Duh.
If you want to see by yourself, just download DBVisualizer Free, configure the Apache Hive driver, open a connection, and check the Database Info tab.

Now, DBVis is quite permissive with lame drivers, but it seems that LibreOffice is not.

You can try the Cloudera Hive JDBC driver as an alternative. You just have to "register" -- i.e. leave your e-mail address -- to access the download URL; it's simpler to deploy than the Apache thing (based on the Simba SDK, all Hive-specific JARs are bundled) and it works with about any BI tool. So hopefully it works with LibreThing too.

Disclaimer: I wish the Apache distro had a proper JDBC driver, and anyone could use it instead of relying of "free" commercial software. But for now it's just a wish.

Samson Scharfrichter
  • 8,884
  • 1
  • 17
  • 36
  • Thanks @Samson. That's really helpful insight. I see that the Cloudera Hive drivers are currently only packaged for Redhat and Suse (I'm using Ubuntu). The DbVisualizer tool is cool - I've not seen that before and, like you said, clearly identifies various unsupported methods. – Alex Woolford Jul 11 '16 at 15:49
  • Don't get fooled by the "packaging" stuff - it makes sense for ODBC *(native compilation of C code)* but not for JDBC *(just a bunch of portable JARs, you can compile them in Eclipse on Windows and use them later on Linux or AIX)*. Download **any** of the "JDBC packages", open the ZIP, choose between the JDBC 4.0-compliant and JDBC 4.1-compliant variant (depends on what LibreBureau supports), and drop the JARs somewhere on Windows and.or Linux. – Samson Scharfrichter Jul 11 '16 at 19:03
  • @Alex, one more thing: the latest version of the Cloudera Impala JDBC driver has a bug -- in some specific configurations (i.e. with SSL enabled) it fails with bizarre messages about "sockets already open" at connect time. I suspect that it shares the same code base with the Hive driver. If you get bizarre messages yourself, try some older version... – Samson Scharfrichter Jul 11 '16 at 19:10