NoSQL JSON Data Type - The exampleJsonTable Example

The exampleJsonTable is used to demonstrate Hive queries on an Oracle NoSQL Database table in which one of the table's fields (columns) contains text in valid JSON format; that is, a JSON document. For this example table, a schema is employed that consists of only two fields: a field of type FieldDef.Type.INTEGER representing a unique identifier used for the primary key, and a field of type FieldDef.Type.JSON, in which each row in the field contains a JSON document consisting of attributes corresponding to information about current and former members of the United States senate; for example, a given senator's name, address, birthday, etc.

The Creating and Populating the exampleJsonTable appendix describes the exampleJsonTable in more detail. That appendix also presents a program that can be run to create and populate exampleJsonTable with the sort of data the queries presented in this section expect. Before proceeding, please follow the directions provided in that appendix to create and populate exampleJsonTable with the appropriate example data. Then, prior to executing any Hive queries against exampleJsonTable, first create a Hive external table and map it to the table you created in Oracle NoSQL Database, as shown in the following sections.