Configure the PolarDB input component
The PolarDB input component reads data from a PolarDB data source. When you synchronize data from a PolarDB data source to another data source, you must first configure the PolarDB input component to read from the source, and then configure the target data source. This topic describes how to configure the PolarDB input component.
Prerequisites
-
A PolarDB data source has been created. For more information, see Create a PolarDB data source.
-
The account used to configure the PolarDB input component must have the synchronization read permission for the data source. If the account does not have the required permission, you must apply for it. For more information, see Apply for, renew, and revoke permissions on a data source.
Procedure
-
In the top navigation bar of the Dataphin homepage, choose Develop > Data Integration.
-
In the top navigation bar of the integration page, select a Project. If you are using the Dev-Prod mode, you also need to select an environment.
-
In the left-side navigation pane, click offline integration. In the offline integration list, click the offline pipeline you want to develop to open its configuration page.
-
In the upper-right corner of the page, click component library to open the component library panel.
-
In the left-side navigation pane of the component library panel, click Input. From the list of input components on the right, find the PolarDB component and drag it to the canvas.
-
On the PolarDB input component card, click the
icon to open the PolarDB input configuration dialog box. -
In the PolarDB input configuration dialog box, configure the parameters.
Parameter
Description
step name
The name of the PolarDB input component. Dataphin automatically generates a step name, but you can change it as needed. The name must meet the following requirements:
-
Contain only Chinese characters, letters, underscores (_), and digits.
-
Be no more than 64 characters long.
data source
In the drop-down list, select a PolarDB data source. The list includes all available PolarDB data sources, regardless of your permission status. Click the
icon to copy the current data source name.-
If you do not have synchronization read permission for a data source, click Apply next to its name to apply for the permission. For more information, see Apply for, renew, and revoke permissions on a data source.
-
If you do not have a PolarDB data source, click New to create one. For more information, see Create a PolarDB data source.
time zone
Dataphin processes time-formatted data based on the specified time zone. By default, the time zone configured for the selected data source is used and cannot be modified.
NoteFor tasks created before version 5.1.2, you can select Data source default or channel configuration time zone. The default option is channel configuration time zone.
-
Data source default: The default time zone of the selected data source.
-
channel configuration time zone: The time zone configured for the current integration task under Properties > channel configuration.
number of source tables
Select the number of source tables for data synchronization. The options are single table and multiple tables.
-
single table: Use this option to synchronize data from a single source table to a single target table.
-
multiple tables: Use this option to synchronize data from multiple source tables to a single target table. Dataphin uses a union algorithm to combine the data.
table matching mode
Currently, only General Rule can be selected.
NoteThis parameter is configurable 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 enter a keyword to search for the table, or enter the exact table name and click exact match. After you select a table, the system automatically checks its status. Click the
icon to copy the name of the selected table. -
If you set number of source tables to multiple tables, perform the following steps to add tables:
-
In the input box, enter a table expression to match tables with the same schema.
The system supports enumeration, regular expression-like patterns, and a mix of both. For example:
table_[001-100];table_102. -
Click exact match to view a list of matching tables in the Confirm Match Details dialog box.
-
Click Confirm.
-
split key (Optional)
Dataphin shards data based on the specified split key. This parameter, combined with concurrency, enables parallel reads. You can use any column from the source table as the split key. We recommend using the primary key or an indexed column as the split key to ensure optimal transfer performance.
ImportantIf you select a date or time column, Dataphin identifies the minimum and maximum values and splits the data based on the total time range and concurrency level. This process does not guarantee an even data distribution.
batch size (Optional)
The number of records to read in a single batch. Instead of reading one record at a time, you can set a batch size, such as 1,024, to read multiple records at once. This reduces interactions with the data source, improves I/O efficiency, and lowers network latency.
filter (Optional)
A condition to filter the source data, similar to a SQL WHERE clause. For example,
ds=${bizdate}. Use a filter to:-
Read a fixed subset of data.
-
Filter data by using parameters.
output field
This section lists the fields from the selected source table or tables. You can perform the following operations:
-
field management: If you do not want to output certain fields to downstream components, you can remove them.
-
Delete a single field: To remove a small number of fields, click the
icon in the Actions column for the field you want to delete. -
Delete fields in bulk: To remove a large number of fields, 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.
-
-
Batch Add: Click Batch Add to configure fields in bulk in JSON, TEXT, or DDL format.
NoteAfter you add fields in bulk and click OK, the new configuration overwrites the existing field configuration.
-
Example of bulk configuration in JSON format:
// Example: [{ "index": 1, "name": "id", "type": "int(10)", "mapType": "Long", "comment": "comment1" }, { "index": 2, "name": "user_name", "type": "varchar(255)", "mapType": "String", "comment": "comment2" }]Noteindexspecifies the column number,namespecifies the field name after import, andtypespecifies the field type. For example,"index":3,"name":"user_id","type":"String"imports the third column from the source file, names the fielduser_id, and sets its type to String. -
Example of bulk configuration in TEXT format:
// Example: 1,id,int(10),Long,comment1 2,user_name,varchar(255),Long,comment2-
A row delimiter separates each field definition. The default is a newline character (\n), but semicolons (;) and periods (.) are also supported.
-
A comma (,) acts as the column delimiter, separating the index, name, type, mapped type, and comment for each field. The field type can be omitted.
-
-
Example of bulk configuration in DDL format:
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 mapped type. After you finish configuring the row, click the
icon to save.system field: You can select a system field to identify the source of each row of data. After you select a field, the system automatically populates the field type and mapped type. This is useful for synchronizing data from multiple tables, such as sharded databases and tables, to a single target table. The available system fields include:
-
dp_datasource: The name of the data source being synchronized. -
dp_dbname: The name of the database being synchronized, if any. -
dp_schema: The name of the schema being synchronized, if any. -
dp_source_table: The name of the source table being synchronized. -
dp_read_timestamp: The start time of the source SELECT operation.
You can concatenate multiple system fields, for example,
dp_dbname.dp_source_table.Note-
The field type and mapped type of a system field cannot be modified.
-
The
dp_read_timestampsystem field must be configured separately and cannot be concatenated.
-
-
-
Click Confirm to save the configuration for the PolarDB input component.

icon to save.