Drill JDBC Drivers
Download the Drill JDBC driver and use it on all platforms to connect BI tools, such as SQuirreL to Drill.
- This driver is a modified version of the Apache Drill JDBC Driver with different dependencies, and support for MaprSasl authentication.
- This driver cannot be used with an Apache Drill cluster, and conversely, the standard Apache Drill JDBC driver cannot be used with the HPE Drill cluster.
Drill JDBC Driver Download
Use the driver version that matches the version of the installed Drill cluster. Older driver versions may not be compatible with newer Drill versions.
mapr-drill-internal
package installed. You can find the driver in following
path:$DRILL_HOME/jars/jdbc-driver/drill-jdbc-all-<drill-version>.jar
Drill Version | JDBC Version |
EEP-9.3.1+ or Drill 1.21.2.0+ | 1.21.2.100 |
Driver Class
org.apache.drill.jdbc.Driver
Authentication methods
- MaprSasl (default authentication method for secured cluster).
- Plain.
- Kerberos.
auth
connection string
parameter.auth=plain
, the client uses the MaprSasl authentication for connecting
to the ZooKeeper on [random connection type]
(See Random Connection for details),
however, authentication to drillbit uses auth=plain
parameter.JDBC Connection String
The Drill JDBC Driver connection string prefix is: jdbc:drill:*
.
The Driver supports two types of connections, Direct and Random.
The Direct connection is a straightforward connection, allows you to connect to a specific drillbit or multiple drillbits, that you define.
jdbc:drill:drillbit=<hostname>[:<port>][,<hostname2>[:<port>],...];[propertyName=propertyValue[;propertyName2=propertyValue2;...]]
For
example:jdbc:drill:drillbit=node1.cluster.com:31010;auth=maprsasl
or
you can provide a list of drillbits to connect
to:jdbc:drill:drillbit=node1.cluster.com:31010,node2.cluste.com:31010;auth=maprsasl
The
JDBC driver attempts to connect to any node from the list until a successful
connection is established. The order of nodes in the connection string does not guarantee
the order in which the client attempts to connect to the drillbits. The client attempts to
connect to a node n
times, as defined by the tries
parameter, or 5 times by default.The default drillbit node port is 31010. If this port has not been changed, you can omit it from the connection string.
The Random connection allows the client to retrieve a list of active drillbit nodes from the ZooKeeper to connect to.
jdbc:drill:zk=<zk host name>:<port>[,<zk host name2>:<port>...]<directory>/<cluster ID>;[propertyName=propertyValue[;propertyName2=propertyValue2;...]]
For
example:jdbc:drill:zk=node1.cluster.com:5181/drill/hpe.cluster-drillbits;auth=maprsasl
or
you can provide multiple ZooKeeper
nodes:jdbc:drill:zk=node1.cluster.com:5181,node2.cluste.com:5181/drill/hpe.cluster-drillbits;auth=maprsasl
The client attempts to connect to each ZooKeeper node in the specified order. If the connection to one node fails, the client proceeds to the next node in the list until all nodes are tried or a connection is established successfully. By default, the driver will attempt to connect to each node up to 15 times, with a 500 ms timeout for each attempt, before reporting failure.
<directory>/<cluster ID>
is optional if you use Sqlline
client since it retrieves the relevant
values from this node drillbit configuration.
After establishing a connection with a ZooKeeper node and retrieving the list of active drillbit nodes, the driver behaves exactly the same as for a direct connection. In the JDBC driver, ZooKeeper is used solely to retrieve the active drillbits for the corresponding cluster.
JDBC connection string parameters
Parameter | Default Value | Allowed values | Description |
---|---|---|---|
auth | - |
|
Authentication method. |
schema | - | Name of enabled storage plugin | The name of a storage plugin configuration to use as the default for
queries. For example, |
enableTLS | false |
|
To enable/disable TLS encryption.. |
trustStoreType | JKS |
|
Type of the trust store. This option is considered only if |
trustStorePath | - | String value | Path to the truststore will be used. If the default Java
truststore is not available, the
trustStorePassword parameter will be ignored.
Note that The
order of looking for the default truststore then will be in
java-home/lib/security/jssecacerts . |
trustStorePassword | - | String value | Password to the truststore |
TLSHandshakeTimeout | 10000 | numeric value, time in milliseconds | This option sets the time for the client to time out. If this value is not set, the TLS handshake may fail and leave the client in nonresponsive state. |
TLSProvider | JDK |
|
Changes the underlying implementation to the chosen value. |
useSystemTrustStore | false |
|
Windows only If provided, the client reads certificates from the Windows
|
disableHostVerification | false |
|
If set to Hostname verification follows the specification outlined in RFC 2818. This option is considered only if |
disableCertificateVerification | false |
|
If set to This option is considered only if |
TLSProtocol | TLSv1.3 |
|
Version of TLS protocol. This option is considered only if |
tries | 5 | numeric value | The maximum number of unique drillbits to which the client will attempt to establish a successful connection. |
quoting_identifiers | ` |
|
Identifier quotes. |
Connecting to Drill via the Drill Shell (SQLLine)
Driver Limitations
When using MapR-SASL with JDBC or ODBC drivers, there is no way to specify the target
cluster name as part of the connection parameters. MapR-SASL reads the first entry in the
/opt/mapr/conf/mapr-clusters.conf
file and assumes it is the target
cluster name.
For example, if the mapr-clusters.conf
file has an entry for
'cluster1
' followed by an entry for 'cluster2
' and you
want to connect to a node in 'cluster2
', authentication fails. As a
workaround, manually switch the order of entries in the mapr-clusters.conf
file.