tencent cloud

腾讯云数据仓库 TCHouse-D

产品简介
产品概述
基本概念
集群架构
产品优势
应用场景
购买指南
计费概述
续费说明
到期与欠费说明
退费说明
配置变更计费说明
快速入门
通过控制台使用腾讯云数据仓库 TCHouse-D
通过客户端使用腾讯云数据仓库 TCHouse-D
操作指南
集群操作
监控和告警配置
账户权限管理
数据管理
查询管理
配置管理
节点管理
日志分析
SQL 工作区
开启资源隔离
开发指南
数据表设计
数据导入
数据导出
基础功能
查询优化
生态扩展功能
API 文档
History
Introduction
API Category
Making API Requests
Cluster Operation APIs
Database and Table APIs
Cluster Information Viewing APIs
Hot-Cold Data Layering APIs
Database and Operation Audit APIs
User and Permission APIs
Resource Group Management APIs
Data Types
Error Codes
云上生态
为子账号授予 CAM 策略
查询加速腾讯云 DLC
实践教程
基本功能使用
高级特性使用
资源规格选型及调优建议
命名规范及库表限制
表设计与数据导入
查询调优
建议规避的用法
通过 JDBC 方式公网访问 TCHouse-D
性能测试
TPC-H 性能测试
SSB 性能测试
TPC-DS 性能测试
常见问题
常见操作问题
常见报错
联系我们
词汇表
产品协议
服务等级协议
隐私政策
数据处理和安全协议

DescribeCreateTablesDDL

聚焦模式
字号
最后更新时间: 2025-10-30 21:32:25

1. API Description

Domain name for API request: cdwdoris.intl.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.intl.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.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈