When you configure a target with an existing schema, you can optionally define rules for renaming the target tables that correspond to the selected source tables.
For target messaging systems, such as Apache Kafka, the rule renames the table name in the output messages.
To create a rule for renaming tables:
Under
Table Renaming Rules
, in the
Create Rule
fields, enter a source table name or a table name mask that includes one or more wildcards. Then enter the corresponding target table name or table name mask.
For the source, you can enter only the asterisk (*) wildcard to select all source tables that match the table selection criteria on the
Source
page. Or you can enter a specific source table name or a table-name mask that includes one or more of the following wildcards: an asterisk (*) to represent one or more characters or a question mark (?) to represent a single character.
To use a table-name mask with the wildcard character for the target, you must also use the wildcard character in the source. If you use a specific source table name with a target table mask that includes the wildcard character, the task deployment will fail.
If a table name includes special characters, such as a backslash (\), asterisk(*), dot (.), or question mark (?), escape each special character in the name with a backslash (\).
Click
Add Rule
.
The rule appears in the rules list.
You can define multiple table rules. The order of the rules does not matter with regard to how they are processed unless a table matches multiple rules. In this case, the last matching rule determines the name of the table.
To delete a rule, click the Delete icon at the right end of the rule row.
Example:
Assume that you want to add the prefix "PROD_" to the names of target tables that correspond to all selected source tables. Enter the following values:
For the source, enter only the asterisk (*) wildcard character to specify all of the selected source tables.
For the target, enter PROD_* to add this prefix to the names of all target tables that match the source tables by name.