Configure the PolarDB-X (formerly DRDS) input component
The PolarDB-X (formerly DRDS) input component reads data from a PolarDB-X data source. It is the first step in a pipeline that synchronizes data to a target data source.
Prerequisites
-
You have created a PolarDB-X data source. For more information, see Create a PolarDB-X data source.
-
Your account needs data synchronization read permissions for the data source. If you do not have these permissions, you must apply for them. For more information, see Apply for, renew, and return data source permissions.
Steps
-
In the top navigation bar of the Dataphin homepage, choose R&D > Data Integration.
-
On the Data Integration page, select a project from the top navigation bar. (In Dev-Prod mode, you must also select an environment.)
-
In the left-side navigation pane, click Batch Integration. In the Batch Integration list, click a batch pipeline to open its configuration page.
-
In the upper-right corner of the page, click Component Library to open the Component Library panel.
-
In the Component Library panel, click Input in the left-side navigation pane. In the list of input components on the right, find the PolarDB-X(formerly DRDS) component and drag it to the canvas.
-
Click the
icon in the PolarDB-X (formerly DRDS) input component card to open the PolarDB-X (formerly DRDS) Input Configuration dialog box. -
In the PolarDB-X (formerly DRDS) Input Configuration dialog box, configure the parameters.
Parameter
Description
Step name
The name of the PolarDB-X input component. Dataphin automatically generates a step name, which you can customize. The name must meet the following requirements:
-
It can contain only Chinese characters, letters, underscores (_), and digits.
-
It must not exceed 64 characters in length.
Data source
From the drop-down list, select the PolarDB-X data source. The list displays all PolarDB-X data sources in Dataphin, including those for which you have or lack permissions. Click the
icon to copy the name of the current data source.-
If you lack data synchronization read permissions for a data source, click Apply next to the data source to request the required permissions. For more information, see Apply for, renew, and return data source permissions.
-
If no PolarDB-X data source exists, click New to create one. For more information, see Create a PolarDB-X data source.
Table
Select the source table for data synchronization. You can search for the table by entering a keyword, or enter the exact table name and click Exact Search. After you select a table, the system automatically checks its status. Click the
icon to copy the name of the selected table.Batch size (Optional)
Specifies the number of records to read in a single operation. Reading data in batches (for example, 1024 records at a time) reduces interactions with the database, which improves I/O performance and network efficiency.
Input filter (Optional)
Specifies a filter condition to extract a subset of data. The syntax is similar to a SQL WHERE clause.
-
Fixed value: Extracts data that matches a specific value. Example:
ds=20211111. -
Variable parameter: Filters data based on a system or custom variable parameter. Example:
ds=${bizdate}.
Output fields
This section displays all fields from the selected table that match the filter condition. You can perform the following operations:
-
Field Management: Remove fields that are not needed by downstream components.
-
To remove a single field: Click the
icon in the Actions column for the field you want to remove. -
To remove multiple fields in bulk: Click Field Management. In the Field Management dialog box, select the fields you want to remove, click the
left arrow icon to move them to the unselected list, and then click OK.
-
-
Click Batch Add to add fields in bulk by using the JSON, TEXT, or DDL format.
NoteWhen you add fields in bulk and click OK, the new configuration overwrites the existing fields.
-
To add 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" }]NoteIn this format,
indexspecifies the column number,namespecifies the field name after import, andtypespecifies the field data type. For example,"index":3,"name":"user_id","type":"String"imports the third column from the file, names the fielduser_id, and sets its data type to String. -
To add 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 separator separates the information of each field, defaults to the newline character (\n), and supports the newline character (\n), a semicolon (;), and a period (.).
-
The column separator is used to separate field names and field types. The default is a half-width comma (,). The supported separator is
',', the field type is optional, and the default is','.
-
-
To add 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 and enter the Field, Type, and Remarks, and select a Mapping Type. Click the
icon to save the row.System fields: System fields identify the origin of each data row. This is useful when synchronizing data from multiple tables (such as sharded databases and tables) to a single target table. When you select a system field, its type and mapping type are populated automatically. The available system fields include:
-
dp_datasource: The name of the source data source. -
dp_dbname: The name of the source database, if applicable. -
dp_schema: The name of the source schema, if applicable. -
dp_source_table: The name of the source table. -
dp_read_timestamp: The start time of theSELECToperation at the source.
You can concatenate multiple system fields. Example:
dp_dbname.dp_source_table.Note-
You cannot modify the field type or mapping type of a system field.
-
dp_read_timestampsupports only standalone configuration and cannot be concatenated.
-
-
-
Click OK to save the component's configuration.

icon to save the row.