Configure the OpenSearch output component

Updated at:

The OpenSearch output component writes data to an OpenSearch data source. When synchronizing data, you must configure this component for the target data source after the source has been configured. This topic describes the configuration procedure.

Prerequisites

Procedure

  1. In the top navigation bar of the Dataphin homepage, choose Develop > Data Integration.

  2. In the top navigation bar, select a project. If you are in Dev-Prod mode, you also need to select an environment.

  3. In the left-side navigation pane, click Offline Integration. In the Offline Integration list, click the offline pipeline to open its configuration page.

  4. In the upper-right corner of the page, click component library to open the component library panel.

  5. In the left-side navigation pane of the component library panel, select Output. In the output component list on the right, find the OpenSearch component and drag it onto the canvas.

  6. Click and drag the image icon on the source component and connect it to the OpenSearch output component.

  7. Click the image icon on the OpenSearch output component card to open the OpenSearch Output Configuration dialog box.

    image

  8. In the OpenSearch Output Configuration dialog box, configure the parameters.

    Parameter

    Description

    Step name

    The name of the OpenSearch output component. Dataphin automatically generates a step name, which you can modify. The name must follow these rules:

    • Can contain only Chinese characters, letters, digits, and underscores (_).

    • Must not exceed 64 characters in length.

    Data source

    The drop-down list displays all OpenSearch data sources, regardless of whether you have write permission.

    Loading policy

    Select a policy for writing data to the target table. The following loading policies are available:

    • Append data: Adds new data to the target table without modifying existing data.

    • Update data: Updates existing data. You must specify an output field to act as the ID, which serves as the primary key for upsert operations.

    • Overwrite data: Deletes all existing data in the target table and replaces it with the data from the source table.

    Index

    Select the target OpenSearch index.

    Field delimiter (Optional)

    Specify the delimiter used to separate fields in your data. If left empty, this parameter defaults to a comma (,).

    Input fields

    Displays the input fields from the upstream component.

    Output fields

    Displays the output fields for the target index.

    • Get field info: Fetches the schema of the selected index.

    • Add fields in bulk

      1. Click Add fields in bulk.

        • To add fields in JSON format, use the following example:

          [{"name":"col_integer","type":"integer"},
           {"name":"col_long","type":"long"},
           {"name":"col_double","type":"double"}]
          Note

          name is the name of the field to import, and type is its data type. For example, "name":"user_id","type":"String" imports a field named user_id with a String data type.

        • To add fields in TEXT format, use the following example:

          col_long,long
          col_double,double
          • Use a row delimiter to separate each field definition. The default is a newline character (\n). Semicolons (;) and periods (.) are also supported.

          • Use a column delimiter to separate the field name and its type. The default is a comma (,).

      2. Click OK.

    • Create output field.

      Click Create output field, then enter a field name and select a type.

    • Copy upstream fields.

      Uses the input fields from the upstream component as the output fields.

    • Manage output fields.

      You can perform the following actions on existing fields:

      • Drag the image move icon next to a field to reorder it.

      • Click the agag edit icon in the Actions column to edit a field.

      • Click the agfag delete icon in the Actions column to delete a field.

    Mappings

    Map input fields to output fields to ensure correct data synchronization. The following modes are supported:

    • Map by name: Automatically maps fields that have the same name.

    • Map by row: Maps fields based on their order. Use this mode when field names differ, but their positions correspond.

  9. Click OK to save the configuration for the OpenSearch output component.