Ask Your Question

Connecting to Apache Drill via JDBC

asked 2017-09-30 10:45:21 -0500

mstang gravatar image

updated 2017-09-30 16:12:48 -0500

metadaddy gravatar image

Has anyone successfully connected to Drill via the JDBC origin? I'm getting a strange error when I try...

I can connect from the same server using the same driver with sqlline (both direct and with zookeeper) though it always forces me to do an interactive login (I can't seem to pass UID and PWD in my connect string.

With the JDBC Origin I get this error when I try a JDBC connection direct to a drillbit:

2017-09-29 23:06:56,664 [user:*eusmist] [pipeline:drilltest/drilltest982f5d29-cf85-454d-a843-ae6935e0c2a1] [thread:preview-pool-1-thread-4] ERROR JdbcSource - Cannot connect to specified database: com.streamsets.pipeline.api.StageException: JDBC_06 - Failed to initialize connection pool: com.zaxxer.hikari.pool.PoolInitializationException: Exception during pool initialization: org/apache/hadoop/conf/Configuration
com.streamsets.pipeline.api.StageException: JDBC_06 - Failed to initialize connection pool: com.zaxxer.hikari.pool.PoolInitializationException: Exception during pool initialization: org/apache/hadoop/conf/Configuration
        at com.streamsets.pipeline.lib.jdbc.JdbcUtil.createDataSourceForRead(
        at com.streamsets.pipeline.stage.origin.jdbc.JdbcSource.init(
        at com.streamsets.pipeline.api.base.BaseStage.init(
        at com.streamsets.pipeline.configurablestage.DStage.init(
        at com.streamsets.datacollector.runner.StageRuntime.init(
        at com.streamsets.datacollector.runner.StagePipe.init(
        at com.streamsets.datacollector.runner.StagePipe.init(
        at com.streamsets.datacollector.runner.Pipeline.initPipe(
        at com.streamsets.datacollector.runner.Pipeline.init(
        at com.streamsets.datacollector.runner.Pipeline.validateConfigs(
        at com.streamsets.datacollector.runner.preview.PreviewPipeline.validateConfigs(
        at com.streamsets.datacollector.execution.preview.sync.SyncPreviewer.validateConfigs(
        at com.streamsets.datacollector.execution.preview.async.AsyncPreviewer$
        at com.streamsets.pipeline.lib.executor.SafeScheduledExecutorService$SafeCallable.lambda$call$0(
        at com.streamsets.pipeline.lib.executor.SafeScheduledExecutorService$
        at Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$ Source)
        at Source)
Caused by: com.zaxxer.hikari.pool.PoolInitializationException: Exception during pool initialization: org/apache/hadoop/conf/Configuration
        at com.zaxxer.hikari.pool.HikariPool.initializeConnections(
        at com.zaxxer.hikari.pool.HikariPool.<init>(
        at com.zaxxer.hikari.HikariDataSource.<init>(
        at com.streamsets.pipeline.lib.jdbc.JdbcUtil.createDataSourceForRead(
        ... 21 more
Caused by: java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
        at ...
edit retag flag offensive close merge delete



What jars did you install into your

directory? It looks like this driver requires a class that is part of the `hadoop-common` artifact. Was that packaged with your driver? If so, it will need to be included along with the driver jar.

jeff gravatar imagejeff ( 2017-10-04 14:39:04 -0500 )edit

The only jar I've included was drill-jdbc-all-1.10.0.jar. This is the only jar I'm using with sqlline to connect from the same server. I agree it seems to be looking for hadoop-common, I'm just not sure why...

mstang gravatar imagemstang ( 2017-10-05 07:42:01 -0500 )edit

Perhaps it has to do with the authentication mechanism, purely based on the stack trace? When you use the command line tool, are you using the "plain" mechanism as SDC is apparently using?

jeff gravatar imagejeff ( 2017-10-05 12:50:46 -0500 )edit

Also, I notice that this driver is expecting drill-java-exec as a provided dependency, which is itself what includes hadoop-common. See

jeff gravatar imagejeff ( 2017-10-05 13:16:51 -0500 )edit

I also think it has something to do with the way it is authenticating... as I mentioned originally from the cli tool if I specify auth=PLAIN and try to pass a username and password it seems to ignore it and force an interactive login.

mstang gravatar imagemstang ( 2017-10-06 12:45:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-25 14:17:10 -0500

mstang gravatar image

It took me a while to get back and test this, but the suggestions from Rupal and Jeff were correct. Streamsets needed additional libraries (I'm not exactly sure which ones, I just copied all the Drill JDBC jars and it did work).

edit flag offensive delete link more


oddly, this does not behave the same at all version levels. In 3.1.3 I only needed the single driver file but I had to change my legacy drivers jdbc class field to org.apache.drill.jdbc.Driver and add a validation query of "SELECT 1 FROM 1" and select auto commit under advanced tab.

mstang gravatar imagemstang ( 2018-04-22 13:13:58 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-30 10:45:21 -0500

Seen: 174 times

Last updated: Mar 25