Chapter 7. Connecting to Drill

In the past few chapters you have learned how to use Drill to query and explore data, and although this is extremely useful, you can get even more value out of Drill by using it as part of a larger data pipeline. Fortunately, Drill has many interfaces through which you can connect to it and query the results. In principle, the three methods are Open Database Connectivity (ODBC), Java Database Connectivity (JDBC), and Drill’s RESTful interface. In this chapter, you will learn how to use these interfaces and connect to Drill using a wide variety of scripting languages and tools, including Python, R, Java, PHP, and Node.js, as well as some business intelligence (BI) tools such as Apache Superset, Zeppelin, and Tableau.

Understanding Drill’s Interfaces

Before we get into the various language-specific libraries that enable you to easily connect to Drill, it is a good idea to understand the ways in which these libraries connect to Drill. Fundamentally, there are three ways to connect to it:1

  • JDBC

  • ODBC

  • REST interface

In theory, you can use any program that implements one of these standards to programmatically connect to Drill. For instance, if you have some database explorer or visualization tool that uses ODBC, you can use Drill’s ODBC interface to connect the tool to Drill.

JDBC and Drill

Drill is implemented in Java, and as such it makes sense that Drill should implement the JDBC standard to enable other Java-based programs to connect to it. ...

Get Learning Apache Drill now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.