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. Import From PowerCenter
  13. Performance Tuning
  14. Pushdown Optimization
  15. Partitioned Mappings
  16. Developer Tool Naming Conventions

Developer Mapping Guide

Developer Mapping Guide

Defining a DDL Query to Create or Replace the Target at Run Time

Defining a DDL Query to Create or Replace the Target at Run Time

When you select the Target Schema Strategy option to create or replace the target at run time, you can define a DDL query based on which the Data Integration Service must create or replace the target table at run time. You can define a DDL query for relational and Hive targets. You can enter placeholders and parameters in the DDL query.
  1. In the
    Properties
    view, click the
    Advanced
    tab.
  2. Select
    Create or replace table at runtime
    from the
    Target Schema Strategy
    list.
    The
    DDL query
    field is available.
  3. Click
    Edit
    .
    The
    DDL query
    dialog box appears.
  4. Enter the DDL query in the editor.
    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 port selectors.
    The placeholder names are case sensitive. You must enclose the placeholders within two curly brackets. For example, {INFA_TABLE_NAME}.
    You can also perform the following steps to define the DDL query.
    • To add a column name, double-click a column in the
      Columns
      tab.
    • To define a parameter, click the
      Parameters
      tab, and double-click a parameter name. You can also click
      Manage Parameters
      to add, edit, or delete parameters.
    • To configure a port selector, click the
      Port Selector
      tab, and double-click a port selector. You can also click
      New
      to configure a new port selector.
    The following image shows a DDL query to create a Hive target table:
    The image shows a DDL query to create a Hive target table. The query uses the INFA_TABLE_NAME, INFA_COLUMN_LIST, and INFA_PORT_SELECTOR placeholders. It also uses a parameter to define the storage format.
    The DDL query in the image contains the INFA_TABLE_NAME, INFA_COLUMN_LIST, and INFA_PORT_SELECTOR placeholders. It also contains a parameter to define the storage format.
    If you do not enter a DDL query, the Data Integration Service creates the target based on the mapping flow or data object.
  5. Click
    OK
    to save the DDL query.

0 COMMENTS

We’d like to hear from you!