Configure the openGauss input component

Updated at:

The openGauss input component reads data from an openGauss data source. To synchronize data from one openGauss data source to another, first configure the input component to read from the source, and then configure the destination data source. This topic describes how to configure the openGauss input component.

Prerequisites

Procedure

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

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

  3. In the left-side navigation pane, click Batch Integration. In the Batch Integration list, click the batch pipeline you want to develop 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 Input. From the list of input components on the right, find the openGauss component and drag it to the canvas.

  6. On the openGauss input component card, click the image icon to open the openGauss Input Configuration dialog box.

  7. In the openGauss Input Configuration dialog box, configure the parameters.

    Parameter

    Description

    Step name

    The name of the openGauss input component. Dataphin automatically generates a step name, and you can change it to suit your business requirements. The name must meet the following requirements:

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

    • Cannot exceed 64 characters in length.

    Data source

    In the drop-down list, select an openGauss data source. The list shows all openGauss data sources in Dataphin, regardless of whether you have sync read permissions. Click the image icon to copy the name of the current data source.

    Schema

    You can read tables from multiple schemas. Select the schema where the source table is located.

    Source Tables

    Select whether to read from a single table or multiple tables. The options are Single table and Multiple tables.

    • Single table: Use this option to synchronize business data from one source table to one destination table.

    • Multiple tables: Use this option to synchronize business data from multiple source tables to a single destination table. Data from multiple tables is merged into one table by using a union operation.

    Table Matching Method

    You can select General Rule or Database Regex.

    Note

    You can configure this option only when you select multiple source tables.

    Table

    Select the source table or tables.

    • If you select single table for Source Tables, you can enter table name keywords to search, or enter the exact table name and click Exact Match. After you select a table, the system automatically checks its status. Click the image icon to copy the name of the selected table.

    • If Source Table Quantity is set to Multiple Tables, you can enter different expressions to add tables based on the table matching method.

      • If you selected General Rule as the table matching method, enter a table expression in the input field to filter for tables that have the same structure. The system supports enumerations, regular expression-like patterns, and a mix of both. For example: table_[001-100];table_102;.

      • If you selected Database Regex as the table matching method, enter a regular expression that is supported by the current database. The system matches tables in the source database based on this expression. When the task runs, it dynamically matches a new range of tables for synchronization based on the database regular expression.

      After you enter the expression, click Exact Match to view a list of matched tables in the Confirm Match Details dialog box.

    Split key

    You can specify a column with an integer data type in the source table as the split key. We recommend using a primary key or an indexed column as the split key. The system partitions data by the split key to enable parallel reads, which improves data synchronization efficiency.

    Fetch size

    The number of rows to read in a single batch. Setting a fetch size, such as 1024, allows you to read data in batches rather than row by row. This method reduces round trips to the data source, improving I/O efficiency and lowering network latency.

    Input filter

    Specifies the filter condition for the input data, for example, ds=${bizdate}. The input filter is typically used in the following scenarios:

    • Filtering a fixed portion of the data.

    • Filtering with parameters.

    Output field

    This section displays all fields from the selected tables that match the filter conditions. You can perform the following operations:

    • Manage fields: If you do not need to output certain fields to downstream components, you can remove them.

      • To delete a single field: If you want to remove only a few fields, click the sgaga icon in the Actions column for each unnecessary field.

      • To delete fields in bulk: If you want to remove a large number of fields, click Manage Fields. In the Manage Fields dialog box, select the fields that you want to remove, click the image left arrow icon to move them to the unselected list, and then click OK.

        image..png

    • Add in Bulk: Click Add in Bulk to configure fields by using the JSON, TEXT, or DDL format.

      Note

      After you add fields in bulk and click OK, the existing field configuration is overwritten.

      • Configure fields in bulk by using the JSON format. Example:

        // Example:
          [{
             "index": 1,
             "name": "id",
             "type": "int(10)",
             "mapType": "Long",
             "comment": "comment1"
           },
           {
             "index": 2,
             "name": "user_name",
             "type": "varchar(255)",
             "mapType": "String",
             "comment": "comment2"
         }]
        Note

        The index parameter specifies the column number of the object, name specifies the field name after import, and type specifies the field type after import. For example, "index":3,"name":"user_id","type":"String" imports the third column from the file, renames the field to user_id, and sets the field type to String.

      • Configure fields in bulk by using the TEXT format. Example:

        // Example:
        1,id,int(10),Long,comment1
        2,user_name,varchar(255),Long,comment2
        • The row delimiter separates the information for each field. The default is the newline character (\n). The semicolon (;) and period (.) are also supported.

        • The column separator is used to separate field names from field types. The default is a half-width comma (,). The ',' separator is supported. The field type can be omitted, and the default is ','.

      • Configure fields in bulk by using the DDL format. Example:

        CREATE TABLE tablename (
        	user_id serial,
        	username VARCHAR(50),
        	password VARCHAR(50),
        	email VARCHAR (255),
        	created_on TIMESTAMP,
        );
    • New output field: Click + New output field and follow the prompts to enter the Field, Type, and Comment, and select a Mapping Type. After you configure the row, click the image icon to save the settings.

      System field: You can select a system field to identify the source of each row of data. This is useful when you synchronize data from multiple tables, such as sharded tables, to a single destination table. After you select a system field, the system automatically populates the field type and mapping type. The available system fields are:

      • dp_datasource: The name of the data source being synchronized.

      • dp_dbname: The name of the database being synchronized, if applicable.

      • dp_schema: The name of the schema being synchronized, if applicable.

      • dp_source_table: The name of the source table being synchronized.

      • dp_read_timestamp: The start time of the SELECT operation at the source.

      You can concatenate multiple system variables, for example, dp_dbname.dp_source_table.

      Note
      • You cannot modify the field type and mapping type of system fields.

      • dp_read_timestamp supports only individual configuration, not concatenation.

  8. Click Confirm to save the configuration of the openGauss input component.