Hive Connector > Mappings, elastic mappings, and mapping tasks with Hive Connector > Elastic mapping task example
  

Elastic mapping task example

You can create an elastic mapping that runs on the elastic cluster to achieve faster performance when you read from and write data to a Hive table.
In the elastic mapping, you can choose to add transformations to process the data that you read from the source and then write the data to the Hive table.
The following example illustrates how to create a simple elastic mapping that reads data from a Hive table, filters the data based on a customer name before writing to the Hive target table:
The mapping includes a source, filter, and target transformations that read from and write to a Hive table.
    1. In Data Integration, click New > Mappings > Elastic Mapping > Create.
    The New Mapping dialog box appears.
    2. Enter a name, location, and description for the mapping.
    3. Add a Source transformation, and specify a name and description in the general properties.
    4. On the Source tab, perform the following steps to read data from the Hive source:
    1. a. In the Connection field, select the Hive connection.
    2. b. In the Source Object field, select single object as the source type.
    3. c. In the Object field, select the Sales object that has the billing details.
    4. d. In the Advanced Properties section, specify the required parameters.
    The following image shows the configured Source transformation properties that reads the billing data from the Hive object:
    The Hive source properties show the configured Sales object from where you read the data.
    5. Add a Filter transformation, and on the Filter tab, define an expression to filter the records based on the customer name:
    The following image shows the configured Filter transformation properties:
    The image shows the filter condition to filter records based on the customer name.
    6. Add a Target transformation, and specify a name and description in the general properties.
    7. On the Target tab, specify the details to write data to Hive:
    1. a. In the Connection field, select the Hive target connection.
    2. b. In the Target Type field, select single object.
    3. c. In the Object field, select the Hive object to which you want to write the filtered data.
    4. d. In the Operation field, select the insert operation.
    5. e. In the Advanced Properties section, specify the required advanced target properties.
    6. The following image shows the configured Hive Target transformation properties:
      The Hive target properties show the selected Hive target table where you want to write the data.
    8. Click Save > Run to validate the mapping.
    In Monitor, you can monitor the status of the logs after you run the task.