Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6145

Enable usage of Hive MapR-DB JSON handler

    XMLWordPrintableJSON

Details

    Description

      Similar to "hive-hbase-storage-handler" to support querying MapR-DB Hive's external tables it is necessary to add "hive-maprdb-json-handler".

      Use case:

      1. Create a table MapR-DB JSON table:
        _> mapr dbshell_
        
        _maprdb root:> create /tmp/table/json_  (make sure /tmp/table exists)
        
        • insert data
          insert /tmp/table/json --value '\{"_id":"movie0000002" , "title":"Developers on the Edge", "studio":"Command Line Studios"}'
          
          insert /tmp/table/json --id movie0000003 --value '\{"title":"The Golden Master", "studio":"All-Nighter"}'
          
          

           

      2. Create a Hive external table:
        hive> CREATE EXTERNAL TABLE mapr_db_json_hive_tbl ( 
            > movie_id string, title string, studio string) 
            > STORED BY 'org.apache.hadoop.hive.maprdb.json.MapRDBJsonStorageHandler' 
            > TBLPROPERTIES("maprdb.table.name" = "/tmp/table/json","maprdb.column.id" = "movie_id");
        

         

      3. Use hive schema to query this table via Drill:
        0: jdbc:drill:> select * from hive.mapr_db_json_hive_tbl;
        

      Attachments

        Issue Links

          Activity

            People

              vitalii Vitalii Diravka
              vitalii Vitalii Diravka
              Vlad Rozov Vlad Rozov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: