Configure one-click table creation templates
This topic describes how to configure the one-click table creation DDL template for an output component in an offline integration task.
How it works
When you configure the output component of an offline integration task, if the destination table does not exist, you can use the one-click table creation feature to create the destination table. The system automatically generates a CREATE TABLE statement by replacing placeholders in the DDL template for the output component, using the source table schema.
One-click table creation templates let you maintain DDL templates for each output component in your tenant. This helps standardize table creation specifications and common syntax within your tenant. If you do not configure a template for an output component, the system uses its default template. A custom template overrides the default for that tenant.
Supported output components
You can configure DDL templates for the following output components: MySQL, Oracle, PostgreSQL, Hive (for Hive, Hudi, Iceberg, and Paimon tables), MaxCompute (for standard and Delta tables), AnalyticDB for MySQL 3.0, AnalyticDB for PostgreSQL, OushuDB, Hologres, TDH Inceptor, DM, openGauss, StarRocks, Greenplum, ArgoDB, Doris, SelectDB, Lindorm, GaussDB(DWS), Databricks, Amazon Redshift, Amazon RDS for PostgreSQL, Amazon RDS for MySQL, Amazon RDS for Oracle, TDSQL for MySQL, TDSQL for PostgreSQL, DolphinDB, PolarDB-X 2.0, GBase 8c, Snowflake, and YashanDB.
For Hive and MaxCompute, you can configure separate DDL templates for each table type.
Procedure
-
In the top navigation bar of the Dataphin homepage, choose Management Center > Specification Settings.
-
In the left-side navigation pane, choose Development Specification > One-click Table Creation Template.
-
In the output component list, select the target output component.
-
Click Edit and modify the
CREATE TABLEstatement in the DDL template for the selected output component. For details on supported placeholders, see the Supported placeholders section.For Hive and MaxCompute, switch to the tab for the target table type and edit the template separately.
Note-
A single DDL template cannot exceed 1,024 characters.
-
The system does not strictly validate the SQL syntax in the template. It only verifies placeholder validity and displays a prompt if a placeholder is invalid.
-
-
After you finish editing, click Save.
Supported placeholders
When generating a CREATE TABLE statement, the system replaces placeholders in the template using the source table schema. The following table describes the supported placeholders.
|
Placeholder |
Description |
|
|
The name of the destination table. You specify this name in the output component of the offline integration task. |
|
|
A list of fields, including name, type, and comment, generated from the source table. The system converts field types according to the mapping between the source and destination. |
|
|
The comment from the source table. |
|
|
A set of column comment statements generated for each field in the source table. This placeholder is for databases, such as PostgreSQL and Oracle, that require separate comment declarations and is not needed for databases that support inline field comments. |
|
|
The first field in the field list, typically used for a primary key or distribution key. You can replace this placeholder with a specific field name in the template. |
The partition field does not use a placeholder and must be written directly as ds in the template.