CreateTable
You can call the CreateTable operation to create a data table with the specified table schema.
Notes
A newly created table is not immediately available for read and write operations. You must wait for about one minute after the table is created before you can perform these operations.
You can create a maximum of 64 tables in a single instance. To increase this limit, submit a ticket.
Request message structure
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. This includes the following configuration items: Important After a table is created, its schema cannot be modified.
| |
reserved_throughput | Yes | The reserved read throughput and reserved write throughput for the data table. The reserved read throughput and the reserved write throughput cannot exceed 100,000 each. The unit is CU. Use the UpdateTable operation to change the reserved read and write throughput. | |
table_options | No | Includes settings such as TimeToLive and max versions. | |
partitions | No | The partition range of the data table. | |
stream_spec | No | Specifies whether to enable stream properties. | |
sse_spec | No | The encryption configuration for 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. The default value is false. To perform atomic operations for single-row or multi-row reads and writes, enable the local transaction feature for the data table. |
Response message structure
message CreateTableResponse {
}Use an SDK
You can use an SDK in one of the following languages to create a data table.