Category: NoSql

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

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.

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.

The same results in mongodb client shell as shown below.

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.