Apache Drill: Installation and Configuration

In this tutorial, we are going to install and configure Apache Drill 1.3.0 on Ubuntu 16.04.

But, before starting with the installation and configuration, let us get to know about Apache Drill.

Following is the minimum information we should know before going ahead with Apache Drill Installation and Configuration.

  • Drill converts CSV files, NoSQL Databases on-the-fly to query them using SQL.
  • It reduces most of the overhead for extracting analysis out of the data and enables users to focus more on important and things that matter.
  • It is a revolutionary project by Apache, enabling millions of users to ping files and NoSQL tables to extract useful analysis.

Now, let us dive into the installation document we are going to follow to install Apache Drill 1.3.0.

Please go through below document which I have uploaded on my GitHub profile.

Following are the steps which you need to follow in order to install Apache Drill 1.3.0 on Ubuntu 16.04
Assumptions : username is hduser
Step 1 : JAVA Installation
If you have already installed JAVA, then you can skip this step.
If JAVA is not installed, then please follow below steps in order to install JAVA 1.7
command 1 : sudo apt-get update
command 2 : sudo apt-get install openjdk
Once above commands are executed successfully, then you can run following command for verification.
$ java -version
Above command should give you output which might look something like this.
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)
JAVA version may be different based on your installation.
Step 2 : Download Drill Package.
$ cd
$ wget http://getdrill.org/drill/download/apache-drill-1.3.0.tar.gz
Step 3 : Extract Drill Package
$ sudo cp apache-drill-1.3.0.tar.gz /usr/local
$ cd /usr/local
$ sudo tar -xvf apache-drill-1.3.0.tar.gz
$ sudo mv apache-drill-1.3.0 drill
Step 4 : Update .bashrc file with following contents
export DRILL_HOME=/usr/local/drill
$ cd
$ sudo nano .bashrc
press CTRL + X
press Y
press ENTER
Step 5 : Running Drill Agent
Changing the permission of drill installation directory
$ sudo chmod -R 777 /usr/local/drill
Running the drill agent
$ sqlline -u jdbc:drill:zk=local
Once you run above command, you will get the drill console window
For verifying Drill installation, you can run following command from different terminal window.
$ jps
Above command's output looks something like this
This completes Apache Drill Installation.
Hope this helps.
Thanks for having a read.

As it is mentioned in the closing about the process running for Apache Drill – SqlLine. The following screenshot depicts the same thing. Please have a look.

Drill Process Execution Confirmation
Drill Process Execution Confirmation

Now it is to log into Apache Drill.

There are two ways in which you can do this. The first one is command prompt approach and the second and the recommended one is through the web interface.

We will see each approach one by one.


We use the following command to log into Drill Command Prompt.

$ sqlline -u jdbc:drill:zk=local

Following screenshot shows you the expected output of above command.

Apache Drill Successful Login
Apache Drill Successful Login



You can put following address in your browser window to access the Apache Drill Web Interface. This is the most preferred way of accessing drill.

The address pattern is as follows.

http://<IP ADDRESS>:8047

Now, there are plenty of ways to find out the IP Addresses. I am showing the most convenient way as below.

You can run command $hostname -I to get the IP Address. Below screenshot gives you the expected output.

hostname command
hostname command

You take this IP Address and insert it into the web browser. Voila, you will get the Apache Drill Web Interface. It looks something like this.

Apache Drill Web Interface
Apache Drill Web Interface

Now, before verifying whether drill works fine or not. Let us take a close look at the tabs present shown in above screenshot.

The Query tab is the one on which we are going to write our SQL queries to get the useful information out of unstructured data.

It looks something like this.

Apache Drill Query Window
Apache Drill Query Window

The Storage tab is the one which shows the various storage types and nodes available for use. We are going to use dfs storage type which enables us to access any file loaded into the system.

It looks something like this.

Apache Drill Storage Types
Apache Drill Storage Types

Now, it is time to test our Drill Interface.

For that, we are going to use below JSON file.

Input JSON file for Drill Query
Input JSON file for Drill Query

Our job is to query the above data with the help of drill interface.

For that, we are going to follow below steps.

  1. Load this file in your system.
  2. Go to Apache Drill Query Web Interface.
  3. Write desired query in the query window.
  4. Hit on Submit
  5. Observe the output

Below screenshot depicts this step-by-step process.

Input File Transfer
Input File Transfer

I am using FileZilla client to copy above mentioned file from my Windows system to the Ubuntu system on which drill is installed.

Note that the complete path of the input file is ‘/home/hduser/drill_input.json

Apache Drill Query Output
Apache Drill Query Output

As you can see from above screenshot, I am running a simple select * query to get the output from the input JSON file which we uploaded a few moments ago.

I think, this explains how the drill works quite clearly. It took the file from the path mentioned in SQL query and on-the-fly converted into a table to give us the result in tabular format as shown above.

The last thing that we should always do is to close the Apache Drill connection. This can be done from the command prompt !quit command. Do not forget the preceding exclamation symbol.

Below screenshot might be helpful.

quit command in drill
quit command in drill


This completed Apache Drill Installation and Configuration.

Hope you people had a good read.






Published by milindjagre

I founded my blog www.milindjagre.co four years ago and am currently working as a Data Scientist Analyst at the Ford Motor Company. I graduated from the University of Connecticut pursuing Master of Science in Business Analytics and Project Management. I am working hard and learning a lot of new things in the field of Data Science. I am a strong believer of constant and directional efforts keeping the teamwork at the highest priority. Please reach out to me at milindjagre@gmail.com for further information. Cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: