Table of Contents

Search

  1. Preface
  2. Introduction to Hive Connector
  3. Hive connections
  4. Mappings and mapping tasks with Hive Connector
  5. Migrating a mapping
  6. Data type reference
  7. Troubleshooting

Hive Connector

Hive Connector

Hive targets in mappings

Hive targets in mappings

In a 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.
The following table describes the Hive target properties that you can configure in a Target transformation in 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.
You can select an existing target object or create a new target at runtime.
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.
Update
1
Updates data to the Hive target.
Delete
1
Deletes data in the Hive target.
Data Driven
1
Determines if the agent inserts, updates, or deletes records in the Hive target table based on the expression you specify.
Reject operation is ignored for the data driven operation type.
Update Columns
1
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 Condition
1
Enables you to define expressions that flag rows for an insert, update, or delete operation when you select the Data Driven operation type.
Reject operation is ignored for the data driven operation type.
1
Applies only to mappings in advanced mode.
The following table describes the properties that you can configure when you use the
Create New at Runtime
option in a Target transformation in mappings:
Property
Description
Object Name
The name for the target table.
External Table
The type of Hive tables such as managed or external to write the data.
Select the check box if you want to create an external table. Clear the checkbox if you want to create a managed table.
Table Location
The path to the managed or external table in the Hive target to store the data.
If you do not specify a path, Data Integration uses the default warehouse directory configured in the Hive server.
Number of Buckets
The number of buckets to create if the table contains bucket columns.
Stored As
The format to store the data in the table location you specify.
You can choose from the following formats:
  • Avro
  • Orc
  • Parquet
  • RC file
  • Sequence file
  • Text file
Additional Table Properties
List of key-value comma-separated pairs of additional properties that you want to configure to create the target table.
Enclose both the key and value within double quotes and specify the following format to include additional properties:
"<property name>"="<value>"
For example, you can configure additional properties such as compression formats or to include comments in the Hive target table by specifying the following properties:
"avro.compression"="BZIP2","orc.compress"="ZLIB", "comment"="table_comment"
Path
The Hive target database name to write the data.
The following table describes the Hive target advanced properties that you can configure in a Target transformation in mappings:
Property
Description
Update as Upsert
1
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.
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.
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.
Schema Override
Overrides the schema of the target object at runtime.
Table Override
Overrides the table of the target object at runtime.
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.
1
Applies only to mappings in advanced mode.

0 COMMENTS

We’d like to hear from you!