Table of Contents

Search

  1. Preface
  2. Mappings
  3. Mapplets
  4. Mapping Parameters
  5. Where to Assign Parameters
  6. Mapping Outputs
  7. Generate a Mapping from an SQL Query
  8. Dynamic Mappings
  9. How to Develop and Run a Dynamic Mapping
  10. Dynamic Mapping Use Cases
  11. Mapping Administration
  12. Export to PowerCenter
  13. Import From PowerCenter
  14. Performance Tuning
  15. Pushdown Optimization
  16. Partitioned Mappings
  17. Developer Tool Naming Conventions

Developer Mapping Guide

Developer Mapping Guide

Define a DDL Query

Define a DDL Query

At run time, the Data Integration Service can create or replace relational and Hive target tables based on a DDL query that you define.
When you configure a target schema strategy in a Write transformation to create or replace the target table, by default, the Data Integration Service drops any existing target table associated with the write object. The Data Integration Service then creates a table based on the mapping flow or data object.
If you want to customize the table or specify additional parameters such as partitions, you can define a DDL query based on which the Data Integration Service must create or replace the target table. The table contains the columns that you define in the DDL query.
To create a partitioned Hive table, use the following syntax:
CREATE TABLE `hiveTable` (`Field` STRING) PARTITIONED BY ({INFA_PORT_SELECTOR: PortSelector})
The following image shows the
DDL query
field:
The image shows the DDL query field.
You can enter placeholders in the DDL query. The Data Integration Service substitutes the placeholders with the actual values at run time. For example, if a table contains 50 columns, instead of entering all the column names in the DDL query, you can enter a placeholder.
You can enter the following placeholders in the DDL query:
INFA_TABLE_NAME
Fetches the target table name at run time.
INFA_COLUMN_LIST
Fetches a list of columns in the target table at run time.
INFA_PORT_SELECTOR
Adds a port selector.
You must enclose the placeholders within two curly brackets. For example, {INFA_TABLE_NAME}.
Configure this functionality on the
Advanced
tab of the data object.

0 COMMENTS

We’d like to hear from you!