Overview

On This Page

Introduction

The NoSQL backend of the Frames API supports Client methods and commands for working with NoSQL data in the platform using the NoSQL database service, which enables storing and consuming data in a tabular format. For more information, see the NoSQL Databases overview.

  • To add, replace, or update a table item, use the write method.

    To create a table, just begin adding items. The table will be created automatically with the first item that you add. See also Creating Tables.

    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 read method.

  • To infer the schema of a NoSQL table and create a schema file, use the infer_schema or infer command of the execute method. Note that that the schema is automatically inferred when using the write method. For more information, see Defining the Table Schema in this overview.

  • To delete a table or specific table items, use the delete method. You can also delete a table by using a file-system command. See Deleting Tables.

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 __name system attribute — see Object Names and Primary Keys. When using the write method to add or update an item in a NoSQL table, you must provide the item’s primary-key value (name) by designating the relevant DataFrame column as an index column. For more information see the index-column note in the documentation of the write method.

Table Schema

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 execute method (infer_schema / infer). For more information about NoSQL table schemas in the platform, see the NoSQL Table Schema Reference.

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.

See Also