Table Columns
Since Amazon DynamoDB tables are schemaless, the cmdlet offers the following two mechanisms to uncover the schema.
Dynamic Schemas
The columns of a table are dynamically determined by scanning data in the first few rows. You can adjust the number of rows that are used by modifying the RowScanDepth property. In addition to the name of the column, the row scan also determines the data type. The following table shows how the different data types supported by Amazon DynamoDB are modeled in the cmdlet.
Amazon DynamoDB Type | Modeled Type | Encoding | Sample Value | |
Boolean | Boolean | Not Required | True | |
String | String | Not Required | USA | |
Blob | String | Not Required | ||
Number | Double | Not Required | 24.0 | |
String Array | String | JSON Array | ["USA","Canada","UK"] | |
Number Array | String | JSON Array | [20,200.5,500] | |
Blob Array | JSON Array | JSON Array | ["ABCD","EFGH"] | |
Document | JSON Object | JSON Object | {"Address":"123 Fake Street","City":"Chapel Hill","Zip":"27516"} | |
List | JSON Array | JSON Array | [{"S":"mystring"},{"NS":[1,2]},{"N":4}] |
Static Schemas
Instead of using dynamically discovered schemas, you can define your own schemas. This will give you more control over the projected columns and also enable you to use other data types such as boolean, datetime, etc. Refer to the CreateSchema Stored Procedure in order to create your own schema. You can simply specify the FileName (fullpath) and TableName of the new schema file, which should match with the name of the Amazon DynamoDB table, and edit the column listing to use it for your own table.
Schemaless Operations
While the schema of the table is necessary to report metadata, data may be selected, inserted, updated, or deleted from columns that do not exist in the schema. Columns that do not already exist in the table schema will have their data types dynamically determined based on the data that is specified. See DynamoDB Queries for more information.