Drill JDBC Driver
MapR provides a downloadable Drill JDBC driver that you can use on all platforms to connect BI tools, such as SQuirreL and Spotfire, to Drill. Drill also includes an embedded JDBC driver.
The downloadable MapR Drill JDBC driver provides read-only access to Drill data sources and supports the security features described in Securing Drill.
$DRILL_HOME/jars/jdbc-driver/drill-jdbc-all-<drill-version>.jar
$DRILL_HOME/jars/drill-jdbc-<drill-version>.jar
MapR Drill JDBC Driver Download and Instructions
Use the version of the driver that correlates with the version of the Drill server installed. Although older versions of the driver may be able to connect to an upgraded version of Drill, the older drivers do not include all the server features available in the newer drivers.
Drill Version | JDBC Version |
1.15.0 | 1.6.0.1001 |
1.14.0 | 1.6.0.1001 |
1.13.0 | 1.5.9.1018 |
1.12.0 | 1.5.8.1017 |
1.11.0 | 1.5.6.1012 |
1.10.0 | 1.5.3.1006 |
com.simba.drill.jdbc41.Driver
and
com.simba.drill.jdbc41.DataSource
. The correct driver classes for MapR
are:com.mapr.drill.jdbc41.Driver
com.mapr.drill.jdbc41.DataSource
- You can indicate the schema parameter in the connection string, as shown in the
following example:
jdbc:drill:zk=10.10.100.30:5181,10.10.100.31:5181,10.10.100.32:5181/drill/drillbits1;schema=hive
- If using the MapR-SASL or Plain authentication mechanism, you must add the Drill JDBC
JAR files and /opt/mapr/lib/* to the classpath of the third-party client tool, as shown
in the following example for SQuirreL when the path to the driver is
C:\driver\MapRDrillJDBC41-1.5.6.1012:
-cp "%SQUIRREL_CP%;C:\driver\MapRDrillJDBC41-1.5.6.1012\*;C:\opt\mapr\lib\*"
The driver JAR files should appear before /opt/mapr/lib/* in the classpath.
- If you plan to use MapR-SASL for authentication on Windows, a MapR user ticket is required. See the Using MapR-SASL for Authentication on Windows section below for instructions.
Using MapR-SASL for Authentication on Windows
Drill is automatically configured with MapR security when you install Drill on a MapR cluster configured with default security. To successfully connect to Drill from a Windows JDBC client, a MapR user ticket must exist on the Windows client in the %TEMP% directory or in the location specified by the $MAPR_TICKETFILE_LOCATION environment variable.
The JDBC driver locates user tickets for the current Windows user in the default ticket location, %TEMP%, or in the location specified by the environment variable, $MAPR_TICKETFILE_LOCATION. See Tickets and Generating a MapR User Ticket for more information.
Example
$ maprlogin password -user mapr
[Password for user 'mapr' at cluster 'Cluster1':]
The MapR credentials for the mapr user in Cluster1 are written to /tmp/maprticket_1000.'C:\Users\TABETH~1\AppData\Local\Temp/maprticket_Tabetha Stephens'
To override this location, set the "MAPR_TICKETFILE_LOCATION" global variable for the Windows user.
Avoiding Driver Conflicts
$DRILL_HOME/jars/jdbc-driver/drill-jdbc-all-1.10.0.jar
$DRILL_HOME/jars/drill-jdbc-1.10.0.jar
Changing
the file extension to rename these files, as shown in the following example, prevents
Drill or any other application, such as SQLLine, from picking up the embedded
driver:$DRILL_HOME/jars/jdbc-driver/drill-jdbc-all-1.10.0.jar.original
$DRILL_HOME/jars/drill-jdbc-1.10.0.jar.original