Overview of the Frames NoSQL Backend
The NoSQL backend of the Frames API supports
To add, replace, or update a table item, use the
To create a table, just begin adding items. The table will be created automatically with the first item that you add. See also Working with NoSQL Data.Note
In the current release —
- When updating a table item (i.e., when writing an item with the same primary-key attribute value as an existing table item), the existing item is overwritten and replaced with the written item.
- All items that are written to a given table must conform to the same schema. For more information, see Table Schema in this overview.
To retrieve items or specific item attributes from a table, use the
To infer the schema of a NoSQL table and create a schema file, use the
infer_schemaor infercommand of the executemethod. Note that that the schema is automatically inferred when using the writemethod. For more information, see Table Schema in this overview.
Item Name and Primary Key
A table item is a data object, and as such needs to be assigned a unique primary-key value, which serves as the item's name and is stored by the platform in the
The NoSQL Frames backend handles structured data.
Therefore, the backend needs to be aware of the schema of the data structure.
When writing NoSQL data by using the platform's Frames or Spark NoSQL DataFrame APIs, the schema of the data table is automatically identified and saved and then retrieved when reading the data with Frames, a Spark DataFrame, or Presto.
However, to use Frames, a Spark DataFrame, or Presto to read NoSQL data that was written to a table in another way (such as using the platform's NoSQL web API), you first need to define the table schema.
You can do this by using the infer-schema command of the
Note that all items in the table must conform to the same schema (i.e., have the same attribute names and types). In the current release, the table schema is updated according to the last write operation and you can only read from the table items that match the updated table schema.