Configuring Apache Drill with MongoDB on Windows

Hi All, first of all “A very Happy New Year” to every one. Today we are doing to an awesome tool “Apache Drill” which is made to query any NoSql Database if the form of tables even though the tables does not exist. With ‘Drill’ we can start querying any non relational database just like relational database. Apache Drill supports almost all NoSql databases and filesystems like HBase, Hadoop File System, MongoDB, Hive, MapR-DB and Amazon-S3 and many more.
We start trating our JSON data just like table data event when its not.
Drill features a JSON data model that enables queries on complex/nested data as well as rapidly evolving structures commonly seen in modern applications and non-relational datastores. Drill also provides intuitive extensions to SQL so that you can easily query complex data.(credits Apache Drill page.)

any-db

Now let us see how to install Apache Drill on you local machine and how to configure it with MongoDB.
1. Download and install Apache Drill from here
2. Download MongoDB from here

once downloaded and installed both of the software, we shall start Apache Drill first.

Step1 : Navigate to /bin/ in command prompt

Step2 : now type the following command sqlline.bat -u “jdbc:drill:zk=local”

your Apache drill should start with out any errors as shown below.
drill-shell

once the Apache drill server is up and running then start the Web Console by hitting the following url.
Step3 : http://localhost:8047/

once you have the web console ready, please go to storage menu and enable mongodb plugin by putting the following content. ensure your mongodb server is up and running before this step is done.
{
“type”: “mongo”,
“connection”: “mongodb://localhost:27017/”,
“enabled”: true
}

once done we can start querying the mongodb same as relational database as shown below.
query-window
query-results

The same results in mongodb client shell as shown below.
mongodb-shell-results

Thats all folks, you have successfully configured Apache Drill with mongoDB. in my next post will be integrating Apache drill to Java and query MongoDB.

Happy Drilling 🙂

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s