Discussion:
Cannot connect over JDBC from LibreOffice Base to Drill (embedded)
Randy Simons
2018-09-01 20:19:16 UTC
Permalink
Hello,

I'm trying to get LibreOffice Base to connect over JDBC to Drill, which I have
running as embedded on the local machine. Unfortunately, when trying to
connect, it fails with "Failure in creating DrillConnectionImpl:
java.lang.NullPointerException".

I found this question on SO, which seems identical: https://stackoverflow.com/
questions/33196668/interfacing-apache-drill-vs-openoffice-libreoffice-via-jdbc
but unfortunately no real answer there. And just like in this question, I have
no problem connecting to Drill over JDBC from SQuireL SQL Client. It lets me
run queries just fine.

Software:

* Drill 1.14, unmodified standard configuration
* LibreOffice 6.0.3.2 (current version of Ubuntu 18.04)
* Kubuntu 18.04
* OpenJDK 1.8.0_181 (Since Drill has issues with Java 9+, I switched from the
default Java 10 to Java 8, using update-java-alternatives)
* I've added apache-drill-1.14.0/jars/jdbc-driver/drill-jdbc-all-1.14.0.jar to
LibreOffice's class path.
* LibreOffice is configured to use JRE 1.8.0_181 (instead of JRE10)

Steps:

* Run drill embedded, via bin/drill-embedded.
* Create a new LibreOffice Base database.
* In the Database Wizard, connect to existing database (JDBC)
* Datasource URL: jdbc:drill:drillbit=localhost
* JDBC driver class: org.apache.drill.jdbc.Driver

"Test class" now confirms the driver can be loaded, and the class is found.
However, "Test Connection" yields: "Failure in creating DrillConnectionImpl:
java.lang.NullPointerException". I couldn't obtain a stack trace from
LibreOffice for further info.

The exception is thrown from within the Drill JDBC driver, but it could very
well be Base which doesn't behave correctly, leading to this problem.

Anything else I can try?

TIA,

Randy
Khurram Faraaz
2018-09-02 04:24:52 UTC
Permalink
Hello Randy,

Do you use a username/password to connect to Drill, in your JDBC connection
string ?
What do the Drill logs say, the drillbit.log and drillbit.out files under
logs directory ?
Can you connect to Drill from sqlline prompt ?

Thanks,
Khurram
Post by Randy Simons
Hello,
I'm trying to get LibreOffice Base to connect over JDBC to Drill, which I have
running as embedded on the local machine. Unfortunately, when trying to
java.lang.NullPointerException".
https://urldefense.proofpoint.com/v2/url?u=https-3A__
stackoverflow.com_&d=DwICAg&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-
mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=YEJu_ibvhyCnvvLOw9hTA7dYUigwgGEpm_
e9_mWWyhg&s=eE9Uw7MSmfpsBlcivEylkGCc9u_LYJcmBSckD6-UGxI&e=
questions/33196668/interfacing-apache-drill-vs-openoffice-libreoffice-via-
jdbc
but unfortunately no real answer there. And just like in this question, I have
no problem connecting to Drill over JDBC from SQuireL SQL Client. It lets me
run queries just fine.
* Drill 1.14, unmodified standard configuration
* LibreOffice 6.0.3.2 (current version of Ubuntu 18.04)
* Kubuntu 18.04
* OpenJDK 1.8.0_181 (Since Drill has issues with Java 9+, I switched from the
default Java 10 to Java 8, using update-java-alternatives)
* I've added apache-drill-1.14.0/jars/jdbc-driver/drill-jdbc-all-1.14.0.jar to
LibreOffice's class path.
* LibreOffice is configured to use JRE 1.8.0_181 (instead of JRE10)
* Run drill embedded, via bin/drill-embedded.
* Create a new LibreOffice Base database.
* In the Database Wizard, connect to existing database (JDBC)
* Datasource URL: jdbc:drill:drillbit=localhost
* JDBC driver class: org.apache.drill.jdbc.Driver
"Test class" now confirms the driver can be loaded, and the class is found.
However, "Test Connection" yields: "Failure in creating
java.lang.NullPointerException". I couldn't obtain a stack trace from
LibreOffice for further info.
The exception is thrown from within the Drill JDBC driver, but it could very
well be Base which doesn't behave correctly, leading to this problem.
Anything else I can try?
TIA,
Randy
Randy Simons
2018-09-02 18:31:22 UTC
Permalink
Hello Khurram,
Post by Khurram Faraaz
Do you use a username/password to connect to Drill, in your JDBC connection
string ?
LibreOffice Base does have inputs for Username and Password, but those are
left empty. The connection string itself doesn't contain authentication
information either, I simply use "jdbc:drill:drillbit=localhost".
Since I'm running the default configuration, in embedded mode, no login is
required.
Post by Khurram Faraaz
What do the Drill logs say, the drillbit.log and drillbit.out files under
logs directory ?
The .log isn't changed when trying to connect from Base. I guess that it's not
even connecting, and thus there is no actual interaction with Drill. There is
no drillbit.out file.
Post by Khurram Faraaz
Can you connect to Drill from sqlline prompt ?
Yes, that is possible:

$ ./sqlline
apache drill 1.14.0
"drill baby drill"
sqlline> !connect jdbc:drill:drillbit=localhost
Enter username for jdbc:drill:drillbit=localhost:
Enter password for jdbc:drill:drillbit=localhost:
0: jdbc:drill:drillbit=localhost>

(username and password left empty)

After this, I can run queries. Also, at this point, the log now mentions the
successful login.

Actually, I'm not even sure if using Base to connect to Drill is something
that should work. I don't know why not, but what do I know?

I have some largish CSV-files, and trying to use LibreOffice Calc to create
some pivot tables and nice charts to analyze the data. I'm hoping to use Drill
as a fast and more versatile way of querying the CSV-files, and use Base to
feed the data into Calc.

Thanks,

Randy

Loading...