Querying MapR DB tables from Drill



1. Create a storage plugin for maprDB in drill Web UI

{
    "type" : "hbase",
     "enabled" : true,
              config" : {
"hbase.table.namespace.mappings" : "*:/tables" #Change the path where you have mapr tables
}
}

2. Connect to drill

./sqline

!connect jdbc:drill:zk=10.10.71.12:5181
 
sqlline> !connect jdbc:drill:zk=10.10.71.12:5181
scan complete in 406ms
Enter username for jdbc:drill:zk=10.10.71.12:5181: mapr
Enter password for jdbc:drill:zk=10.10.71.12:5181: ****
0: jdbc:drill:zk=10.10.71.12:5181>

3. Change the storage plugin to maprdb (or the name you have given)

0: jdbc:drill:zk=10.10.71.12:5181> use maprdb;
+-------+-------------------------------------+
|  ok   |               summary               |
+-------+-------------------------------------+
| true  | Default schema changed to [maprdb]  |
+-------+-------------------------------------+
1 row selected (0.352 seconds)
0: jdbc:drill:zk=10.10.71.12:5181>

4. This should show you the list of tables created

0: jdbc:drill:zk=10.10.71.12:5181> show tables;
+---------------+-------------+
| TABLE_SCHEMA  | TABLE_NAME  |
+---------------+-------------+
| maprdb        | drilltest   |
| maprdb        | maprtable   |
| maprdb        | maprtbl     |
| maprdb        | maprtsttbl  |
| maprdb        | mytable     |
| maprdb        | wordcount   |
+---------------+-------------+
6 rows selected (0.254 seconds)
0: jdbc:drill:zk=10.10.71.12:5181>


5. 0: jdbc:drill:zk=10.10.71.12:5181> select count(*) from wordcount;
+---------+
| EXPR$0  |
+---------+
| 1000    |
+---------+
1 row selected (0.258 seconds)
0: jdbc:drill:zk=10.10.71.12:5181>

Comments

Popular posts from this blog

OpenSSL Certificate creations

HTTP Fs Installation