Schema for the Example Table Named exampleJsonTable

To demonstrate how a Hive query can be applied to an Oracle NoSQL Database table consisting of rows containing JSON documents, a table named exampleJsonTable having the schema shown in the table below is created in the Oracle NoSQL Database store deployed for this example. The data types specified in the schema shown below are defined by the Oracle NoSQL Database table API (see FieldDef.Type)

Table 9-4 Schema for exampleJsonTable

Field Name Field Type
id FieldDef.Type.INTEGER
jsonField FieldDef.Type.JSON

Table 9-5 Primary Key Field Names

Primary Key Field Names
id

The exampleJsonTable will consist of rows with only two fields (columns). The first field contains a unique identification number that will be used as the primary key for the table. The rows of the second field will contain strings in valid JSON format; that is, a JSON document. The attributes of each JSON document in a given row specify information about current and former members of the United States senate; for example, the given senator's name, party affiliation, contact information, etc.

To create a table with the above schema, and populate that table with the desired JSON documents, follow the instructions presented in the next sections to compile and execute the LoadExampleJson program.