tencent cloud

文档反馈

DescribeCreateTablesDDL

最后更新时间:2024-08-30 14:35:10

1. API Description

Domain name for API request: cdwdoris.tencentcloudapi.com.

This API is used to batch obtain the table creation DDL.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeCreateTablesDDL.
Version Yes String Common Params. The value used for this API: 2021-12-28.
Region No String Common Params. This parameter is not required for this API.
InstanceId Yes String Resource ID, TCHouse-D resource ID.
DbTablesInfos.N Yes Array of DbTablesInfo Require the database and table for the table creation DDL.
UserName No String Use the user who has corresponding permissions for operations. If the TCHouse-D cluster uses a kernel account registered by a CAM user, you do not need to fill it in.
PassWord No String Password corresponding to the user. If the TCHouse-D cluster uses a kernel account registered by a CAM user, you do not need to fill it in.
IsBrief No Boolean Whether to hide partition information

3. Output Parameters

Parameter Name Type Description
CreateTablesDDLs Array of CreateTablesDDL DDL information for creating a table
Note: This field may return null, indicating that no valid values can be obtained.
Message String Error message
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Obtaining the Table Creation DDL

This example shows you how to obtain the table creation DDL.

Input Example

POST / HTTP/1.1
Host: cdwdoris.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCreateTablesDDL
<Common request parameters>

{
    "InstanceId": "cdwdoris-bjizjxxx",
    "DbTablesInfos": [
        {
            "DbName": "demo1",
            "TablesName": [
                "unique_idx_col13"
            ]
        },
        {
            "DbName": "demo2",
            "TablesName": [
                "duplicate_list_partition"
            ]
        }
    ]
}

Output Example

{
    "Response": {
        "CreateTablesDDLs": [
            {
                "DbName": "demo1",
                "TablesDDLs": [
                    {
                        "DDLInfo": "CREATE TABLE `unique_idx_col13` (\n  `user_id` LARGEINT NOT NULL COMMENT 'User id',\n  `date` DATE NOT NULL COMMENT 'Date and time of data import',\n  `city` VARCHAR(20) NULL COMMENT 'User's city',\n  `age` SMALLINT NULL COMMENT 'User's age',\n  `sex` TINYINT NULL COMMENT 'User's gender',\n  `f6_decimal` DECIMAL(10, 6) NULL COMMENT 'DECIMAL column',\n  `f7_boolean` BOOLEAN NULL COMMENT 'BOOLEAN column; 0 represents false and 1 represents true.',\n  `f8_double` DOUBLE NULL COMMENT 'DOUBLE column',\n  `f9_float` FLOAT NULL COMMENT 'FLOAT column',\n  `f10_string` TEXT NULL COMMENT 'STRING column',\n  `last_visit_date` DATETIME NULL COMMENT 'User's last access time',\n  `cost` BIGINT NULL COMMENT 'User's total consumption, which is 0 by default.',\n  `max_dwell_time` INT NULL COMMENT 'User's maximum stay time, which is 0 by default.'\n) ENGINE=OLAP\nUNIQUE KEY(`user_id`, `date`, `city`)\nDISTRIBUTED BY HASH(`user_id`) BUCKETS 1\nPROPERTIES (\n\"replication_allocation\" = \"tag.location.default: 1\",\n\"min_load_replica_num\" = \"-1\",\n\"is_being_synced\" = \"false\",\n\"storage_medium\" = \"hdd\",\n\"storage_format\" = \"V2\",\n\"inverted_index_storage_format\" = \"V1\",\n\"enable_unique_key_merge_on_write\" = \"true\",\n\"light_schema_change\" = \"true\",\n\"disable_auto_compaction\" = \"false\",\n\"enable_single_replica_compaction\" = \"false\",\n\"group_commit_interval_ms\" = \"10000\",\n\"group_commit_data_bytes\" = \"134217728\",\n\"enable_mow_light_delete\" = \"false\"\n);",
                        "TableName": "unique_idx_col13"
                    }
                ]
            },
            {
                "DbName": "demo2",
                "TablesDDLs": [
                    {
                        "DDLInfo": "CREATE TABLE `duplicate_list_partition` (\n  `user_id` LARGEINT NOT NULL COMMENT 'User ID',\n  `date` DATE NOT NULL COMMENT 'Date and time of data import',\n  `city` VARCHAR(20) NOT NULL COMMENT 'User's city',\n  `age` SMALLINT NULL COMMENT 'User's age',\n  `sex` TINYINT NULL COMMENT 'User's gender',\n  `f6_decimal` DECIMAL(10, 6) NULL COMMENT 'DECIMAL column',\n  `f7_boolean` BOOLEAN NULL COMMENT 'BOOLEAN column; 0 represents false and 1 represents true.',\n  `f8_double` DOUBLE NULL COMMENT 'DOUBLE column',\n  `f9_float` FLOAT NULL COMMENT 'FLOAT column',\n  `f10_string` TEXT NULL COMMENT 'STRING column',\n  `last_visit_date` DATETIME NULL COMMENT 'User's last access time',\n  `cost` BIGINT NULL COMMENT 'User's total consumption, which is 0 by default.',\n  `max_dwell_time` INT NULL COMMENT 'User's maximum stay time, which is 0 by default.'\n) ENGINE=OLAP\nDUPLICATE KEY(`user_id`, `date`, `city`)\nPARTITION BY LIST(`city`)\n(PARTITION city_bj VALUES IN (\"Beijing\",\"beijing\",\"BEIJING\",\"BeiJing\",\"Beijing\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION city_cd VALUES IN (\"Chengdu\",\"chengdu\",\"CHENGDU\",\"ChengDu\",\"Chengdu\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION city_sh VALUES IN (\"Shanghai\",\"shanghai\",\"SHANGHAI\",\"ShangHai\",\"Shanghai\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p1 VALUES IN (\"haha1\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p10 VALUES IN (\"haha10\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p11 VALUES IN (\"haha11\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p12 VALUES IN (\"haha12\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p13 VALUES IN (\"haha13\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p14 VALUES IN (\"haha14\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p15 VALUES IN (\"haha15\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p16 VALUES IN (\"haha16\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p17 VALUES IN (\"haha17\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p18 VALUES IN (\"haha18\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p19 VALUES IN (\"haha19\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p2 VALUES IN (\"haha2\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p20 VALUES IN (\"haha20\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p21 VALUES IN (\"haha21\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p22 VALUES IN (\"haha22\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p23 VALUES IN (\"haha23\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p24 VALUES IN (\"haha24\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p25 VALUES IN (\"haha25\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p26 VALUES IN (\"haha26\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p27 VALUES IN (\"haha27\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p28 VALUES IN (\"haha28\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p29 VALUES IN (\"haha29\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p3 VALUES IN (\"haha3\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p30 VALUES IN (\"haha30\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p4 VALUES IN (\"haha4\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p5 VALUES IN (\"haha5\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p6 VALUES IN (\"haha6\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p7 VALUES IN (\"haha7\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p8 VALUES IN (\"haha8\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION add_p9 VALUES IN (\"haha9\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_0 VALUES IN (\"wuhan0\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_1 VALUES IN (\"wuhan1\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_10 VALUES IN (\"wuhan10\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_2 VALUES IN (\"wuhan2\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_3 VALUES IN (\"wuhan3\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_4 VALUES IN (\"wuhan4\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_5 VALUES IN (\"wuhan5\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_6 VALUES IN (\"wuhan6\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_7 VALUES IN (\"wuhan7\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_8 VALUES IN (\"wuhan8\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"),\nPARTITION wh_partition_9 VALUES IN (\"wuhan9\") (\"storage_policy\" = \"20240806-16-48-Cold storage\"))\nDISTRIBUTED BY HASH(`user_id`) BUCKETS 1\nPROPERTIES (\n\"replication_allocation\" = \"tag.location.default: 3\",\n\"min_load_replica_num\" = \"-1\",\n\"is_being_synced\" = \"false\",\n\"storage_medium\" = \"hdd\",\n\"storage_format\" = \"V2\",\n\"inverted_index_storage_format\" = \"V1\",\n\"light_schema_change\" = \"true\",\n\"disable_auto_compaction\" = \"false\",\n\"enable_single_replica_compaction\" = \"false\",\n\"group_commit_interval_ms\" = \"10000\",\n\"group_commit_data_bytes\" = \"134217728\"\n);",
                        "TableName": "duplicate_list_partition"
                    }
                ]
            }
        ],
        "Message": "",
        "RequestId": "f8f5e0af-7d36-4b49-8b4d-9c103deef55a"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

联系我们

联系我们,为您的业务提供专属服务。

技术支持

如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

7x24 电话支持