You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Subhajit Ghosh <su...@skipjaq.com> on 2015/03/27 23:30:50 UTC

Fetching nested JSON data in HBase using Apache Drill

I am using Apache Drill to run SQL queries on a HBase table. The value in one of the columns is:
0: jdbc:drill:schema:hbase:zk=localhost> select cast(address['street'] as varchar(20)) from hbase.students;
+------------+
|   EXPR$0   |
+------------+
| {"id": 123} |
+------------+
1 row selected (0.507 seconds)I would like to access the id field using a query. Something like:
0: jdbc:drill:schema:hbase:zk=localhost> select tbl.address['street']['id'] from hbase.students as tbl;
+------------+
|   EXPR$0   |
+------------+
| null       |
+------------+As you can see, this does not work. I am run to similar queries on JSON data in a file. My question is can I query JSON data in HBase.


—
Thanks and Regards,
Subhajit