Configure the Doris input component

Updated at:

This topic describes how to configure the Doris reader component to read data from a Doris data source into Dataphin for data integration and data development.

Prerequisites

Procedure

  1. On the Dataphin homepage, choose Develop > Data Integration from the top navigation bar.

  2. On the top menu bar of the integration page, select Project (in Dev-Prod mode, you must 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 Reader. Find the Doris component in the reader list and drag it to the canvas.

  6. Click the image icon on the Doris reader component card to open the Doris Input Configuration dialog box.

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

    Parameter

    Description

    Step name

    The name of the Doris reader component. Dataphin automatically generates a step name, which you can modify as needed. The name must meet the following rules:

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

    • Must be 64 characters or less.

    Data source

    The Data source dropdown list displays all Doris data sources in Dataphin, including those for which you have synchronization read permissions and those for which you do not. Click the image icon to copy the name of the current data source.

    • If you do not have synchronization read permission on a data source, click Apply next to the data source to request the necessary permission. For more information, see Apply for data source permissions.

    • To create a Doris data source, click New Data Source. For more information, see Create a Doris data source.

    Number of source tables

    Based on your scenario, select a single table or multiple tables with the same structure as the reader. The number of source tables includes Single table and Multiple tables:

    • Single table: This option is suitable for synchronizing business data from one table to one destination table.

    • Multiple tables: This option is suitable for synchronizing business data from multiple tables to the same destination table. When reading from multiple tables, Dataphin uses the UNION algorithm to combine the data.

      For more information about the UNION operator, see INTERSECT, UNION, and EXCEPT.

    Table matching mode

    Select either General rule or Database regular expression.

    Note

    This option can be configured only when Number of source tables is set to Multiple tables.

    Table

    Select the source table or tables.

    • If you set number of source tables to single table, you can search for a table by entering keywords, or enter the full table name and click Precise Search for an exact match. After you select a table, Dataphin automatically checks its status. Click the image icon to copy the selected table name.

    • If number of source tables is set to multiple tables, you can enter different expressions to add tables based on the table matching mode.

      • General rule: Enter an expression to select tables with the same schema. Dataphin supports enumerations, regular expression-like patterns, and a combination of both. For example: table_[001-100];table_102;.

      • Database regular expression: Enter a regular expression that is supported by the source database. Dataphin uses this expression to match tables in the source database. At runtime, the task uses this expression to dynamically match the tables for synchronization.

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

    Split key

    You can specify an integer column from the source table as the split key. For best performance, use a primary key or an indexed column as the split key. Dataphin partitions the data based on this key to perform concurrent reads, improving data synchronization efficiency.

    Batch read size

    Specifies the number of records to read in a single batch. Fetching data in larger chunks instead of one record at a time reduces interactions with the data source, improving I/O efficiency and lowering network latency.

    Input filter

    Specifies a filter condition for data extraction. Examples:

    • To use a fixed value, for example, ds=20210101.

    • To use a variable, for example, ds=${bizdate}.

    Output fields

    The Output Fields area displays all fields from the selected table that match the filter conditions. You can perform the following operations:

    • Field management: Remove fields that you do not need to output to downstream components.

      • Deleting individual fields: If you need to delete a small number of fields, you can click the sgaga icon in the Actions column to delete the unnecessary fields.

      • To remove multiple fields in bulk: Click Field Management. In the Field Management 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

    • Batch add: Click Batch Add to configure fields in bulk by using JSON, TEXT, or DDL format.

      Note

      This action overwrites the existing field configuration when you click OK.

      • To configure fields in bulk by using the JSON format, see the following 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

        index is the column index of the specified object, name is the name of the imported field, and type is the type of the imported field. For example, "index":3,"name":"user_id","type":"String" means that the fourth column of the file is imported, the field name is user_id, and the field type is String.

      • To configure fields in bulk by using the TEXT format, see the following example:

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

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

      • To configure fields in bulk by using the DDL format, see the following example:

        CREATE TABLE tablename (
        	user_id serial,
        	username VARCHAR(50),
        	password VARCHAR(50),
        	email VARCHAR (255),
        	created_on TIMESTAMP
        );
    • Click + New output field, then enter the field, type, and comment, and select a mapping type. Click the image icon to save the row.

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

      • dp_datasource: The name of the synchronized data source.

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

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

      • dp_source_table: The name of the synchronized source table.

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

      You can concatenate multiple system fields, such as dp_dbname.dp_source_table.

      Note
      • You cannot modify the field type or mapping type of a system field.

      • The dp_read_timestamp field must be used alone and cannot be concatenated.

  8. Click Confirm to save the component's configuration.