Hive Connector > Mappings, elastic mappings, and mapping tasks with Hive Connector > Hive targets in mappings and elastic mappings
  

Hive targets in mappings and elastic mappings

In a mapping or an elastic mapping, you can configure a Target transformation to represent a Hive target object. You can use a mapping task to write data to Hive targets that use Sentry authorization.
The following table describes the Hive target properties that you can configure in a Target transformation in mappings and elastic mappings:
Property
Description
Connection
Name of the target connection.
Target type
Type of the target object.
Select one of the following types:
  • - Single Object. Select to specify a single Hive target object.
  • - Parameter. Specify a parameter where you define values that you want to update without having to edit the task.
Object
Target object for a single target.
Note: You can select from an existing target object. The Create New at Runtime option is not applicable.
Operation
The target operation. You can choose from the following options:
Insert
Inserts data to a Hive target.
Upsert (Update or Insert)1
Performs an upsert operation to the Hive target. You must also select the Update as Upsert property for upsert to work. The Secure Agent performs the following tasks:
  • - If the entries already exist in the Hive target, the Secure Agent updates the data.
  • - If the entries do not exist in the Hive target, the Secure Agent inserts the data.
Update1
Updates data to the Hive target.
Delete1
Deletes data in the Hive target.
Data Driven1
Determines if the agent inserts, updates, or deletes records in the Hive target table based on the expression you specify.
Note: Reject operation is ignored for the data driven operation type.
Update Columns1
Columns that identify rows in the target table to update or upsert data.
Select the key columns where you want to upsert or update data in the Hive target table.
Required if you select the Upsert (Update or Insert) option.
Data Driven Condition1
Enables you to define expressions that flag rows for an insert, update, or delete operation when you select the Data Driven operation type.
Note: Reject operation is ignored for the data driven operation type.
1Applies only to elastic mappings.
The remaining properties are applicable for both mappings and elastic mappings.
The following table describes the Hive target advanced properties that you can configure in a Target transformation in mappings and elastic mappings:
Property
Description
Update as Upsert1
Upserts any records flagged for upsert.
This property is required when you select the Upsert (Update or Insert) option and you want to upsert data.
Important: When you select the Update operation and also provide the Update as Upsert flag, the agent supports the upsert operation, not the update operation.
Truncate Target
Truncates the database target table before inserting new rows.
Select the Truncate Target check box to truncate the target table before inserting all rows.
By default, the Truncate Target check box is not selected.
Forward Rejected Rows
Determines whether the transformation passes rejected rows to the next transformation or drops rejected rows. By default, the mapping task forwards rejected rows to the next transformation.
If you select the Forward Rejected Rows option, the Secure Agent flags the rows for reject and writes them to the reject file.
If you do not select the Forward Rejected Rows option, the Secure Agent drops the rejected rows and writes them to the session log file. The Secure Agent does not write the rejected rows to the reject file.
PreSQL
SQL statement that you want to run before writing data to the target.
PostSQL
SQL statement that you want to run after writing the data to the target.
1Applies only to elastic mappings.
The remaining properties are applicable for both mappings and elastic mappings.

Adding a single Hive target object

You need to create a connection before getting started with a mapping task.
The following steps help you to set up a mapping task in Data Integration:
    1. Click New > Mappings.
    2. Select Mapping and click Create.
    3. In the Target Properties page, specify the name and provide a description in the General tab.
    4. Click the Target tab.
    5. Select the target connection and target type as Single Object.
    6. Click Select to select a target object.
    7. Select an existing target object from the list and click OK.
    Note: The Create New at Runtime option is not applicable.
    8. Select the target operation that you want to use.
    9. Select the advanced properties that you want to configure for the target object.
    10. Click Save.