Drill JDBC Drivers

Download the Drill JDBC driver and use it on all platforms to connect BI tools, such as SQuirreL to Drill.

The Drill JDBC driver provides read-only access to Drill data sources, and:
  • 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.

Starting with EEP-9.3.2 or higher, you can retrieve a compatible JDBC driver directly from a cluster that has the mapr-drill-internal package installed. You can find the driver in following path:
$DRILL_HOME/jars/jdbc-driver/drill-jdbc-all-<drill-version>.jar
The following table provides link to the download location for the Drill JDBC drivers that compatible with each of the Drill versions listed:
IMPORTANT
To access the Data Fabric internet repository, you must specify the email and token of an HPE Passport account. For more information, see Using the HPE Ezmeral Token-Authenticated Internet Repository.
Drill Version JDBC Version
EEP-9.3.1+ or Drill 1.21.2.0+ 1.21.2.100

Driver Class

The Driver Class is the same as the Apache Drill JDBC Driver Class, as follows:
org.apache.drill.jdbc.Driver

Authentication methods

Drill JDBC driver supports the following authentication methods:
  • MaprSasl (default authentication method for secured cluster).
  • Plain.
  • Kerberos.
The authentication method is specified with auth connection string parameter.
IMPORTANT
When the HPE Cluster is secured, even if you set 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.

Direct connection

The Direct connection is a straightforward connection, allows you to connect to a specific drillbit or multiple drillbits, that you define.

The general schema is:
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.

Random connection

The Random connection allows the client to retrieve a list of active drillbit nodes from the ZooKeeper to connect to.

The general schema is:
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

The JDBC driver supports various parameters. Following table lists some of parameters:
Table 1. JDBC connection string parameters
Parameter Default Value Allowed values Description
auth -
  • maprsasl
  • plain
  • kerberos
Authentication method.
schema - Name of enabled storage plugin The name of a storage plugin configuration to use as the default for queries.

For example,schema=hive.

enableTLS false

true

false

To enable/disable TLS encryption..
trustStoreType JKS

JKS

PKC12

Windows-MY(Windows only)

Windows-ROOT(Windows only)

Type of the trust store.

This option is considered only if enableTLS is set to true.

trustStorePath - String value

Path to the truststore.

If value is not provided, the default Java 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

JDK

OPENSSL

Changes the underlying implementation to the chosen value.
useSystemTrustStore false

true

false

Windows only

If provided, the client reads certificates from the Windows truststore. In this case,trustStorePath and ustStorePassword, if specified, will be ignored. You must set default provider in $JRE_HOME/lib/security/java.security to SunMSCAPI. The trustStoreType must be set to either Windows-MY or Windows-ROOT.

disableHostVerification false

true

false

If set to true, the driver will not verify whether the host in the certificate matches the host being connected to.

Hostname verification follows the specification outlined in RFC 2818.

This option is considered only if enableTLS is set to true.

disableCertificateVerification false

true

false

If set to true, the driver will not validate the certificate against the truststore.

This option is considered only if enableTLS is set to true.

TLSProtocol TLSv1.3

TLS

TLSV1

TLSv1.1

TLSv1.2

TLSv1.3

Version of TLS protocol.

This option is considered only if enableTLS is set to true.

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)

See 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.