Mapping a Hive External Table to vehicleTable: Non-Secure Store

Assuming you have executed the initial steps to deploy a non-secure store, created and populated the table named vehicleTable in that store, and configured the Hive client environment for interaction with Oracle NoSQL Database, you can then create an external Hive table that maps to that Oracle NoSQL Database table by executing the following Hive command:

CREATE EXTERNAL TABLE IF NOT EXISTS vehicleTable
    (type STRING, make STRING, model STRING, class STRING, color STRING,
        price DOUBLE, count INT, dealerid DECIMAL, delivered TIMESTAMP)
    STORED BY 'oracle.kv.hadoop.hive.table.TableStorageHandler'
    TBLPROPERTIES ("oracle.kv.kvstore" = "example-store", 
        "oracle.kv.hosts" = "kv-host-1:5000,kv-host-2:5000,kv-host-3:5000" 
        "oracle.kv.tableName" = "vehicleTable", 
        "oracle.kv.hadoop.hosts" = "dn-host-1,dn-host-2,dn-host-3");

The command above applies the required data model mapping to create a Hive table named vehicleTable with columns whose types are consistent with the corresponding fields of the Oracle NoSQL Database table specified via the oracle.kv.tableName property.

Note:

Although not necessary, the Hive table that is created is given the same name as the table to which it is mapped in the store.