Creates a data table based on the specified schema.
Usage notes
After you create a data table, you cannot immediately perform read and write operations on the data table. In most cases, you can perform read and write operations on a data table one minute after the data table is created.
You can create up to 64 tables in a single instance. If you want to create more tables in a single instance, submit a ticket.
Request syntax
message CreateTableRequest {
required TableMeta table_meta = 1;
required ReservedThroughput reserved_throughput = 2;
optional TableOptions table_options = 3;
repeated PartitionRange partitions = 4;
optional StreamSpecification stream_spec = 5;
optional SSESpecification sse_spec = 6;
repeated IndexMeta index_metas = 7;
optional bool enable_local_txn = 8;
}Parameter | Type | Required | Description |
table_meta | Yes | The schema of the data table. Configure the following parameters: Important After you create a data table, you cannot modify the schema of the data table.
| |
reserved_throughput | Yes | The reserved read or write throughput of the data table. The reserved read or write throughput of a data table cannot exceed 100,000. Unit: capacity unit (CU). You can call the UpdateTable operation to change the reserved read or write throughput of a data table. | |
table_options | No | The table parameters, including time_to_live and max_versions. | |
partitions | No | The partition range of the data table. | |
stream_spec | No | Specifies whether to enable Stream-related attributes. | |
sse_spec | No | The encryption configurations of the data table. | |
index_metas | No | The schema of the index table. | |
enable_local_txn | bool | No | Specifies whether to enable the local transaction feature for the data table. Default value: false. To perform atomic operations to read or write one or more rows of data, enable the local transaction feature for the data table. |
Response syntax
message CreateTableResponse {
}Use Tablestore SDKs
You can use the following Tablestore SDKs to create a data table based on the specified schema:
Tablestore SDK for Java: CreateTable
Tablestore SDK for Go: CreateTable
Tablestore SDK for Python: CreateTable
Tablestore SDK for Node.js: CreateTable
Tablestore SDK for .NET: CreateTable
Tablestore SDK for PHP: CreateTable