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/write operations on a table one minute after the 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;
    optional StreamSpecification stream_spec = 5;
Parameter Type Required Description
table_meta TableMeta Yes The schema of the data table. The table name must be unique within the instance. A primary key can contain one to four primary key columns. The name of each primary key column must comply with the naming conventions and the data types of the primary key columns must be STRING, INTEGER, or BINARY. For more information about the naming conventions and data types, see Naming conventions and data types.

After you create a table, you cannot modify the schema of the table.

reserved_throughput ReservedThroughput Yes The reserved read or write throughput of the data table. The reserved read or write throughput of a table cannot exceed 100,000.

You can call the UpdateTable operation to change the reserved read or write throughput of a data table.

table_options TableOptions No The settings of time to live (TTL) and max versions.
stream_spec StreamSpecification No Specifies whether to enable Stream-related attributes.

Response syntax

message CreateTableResponse {

Use Tablestore SDKs

You can use the following Tablestore SDKs to create a data table based on the specified schema: