The AnalyticDB for MySQL 3.0 input component reads data from an AnalyticDB for MySQL 3.0 data source. To sync data from an AnalyticDB for MySQL 3.0 data source to another data source, you must configure the AnalyticDB for MySQL 3.0 input component before you configure the destination data source. This topic describes how to configure the AnalyticDB for MySQL 3.0 input component.
Prerequisites
Before you begin, complete the following steps:
Create an AnalyticDB for MySQL 3.0 data source. For more information, see Create an AnalyticDB for MySQL 3.0 Data Source.
The account used to configure the AnalyticDB for MySQL 3.0 input component must have read-through permission on the data source. If the account does not have this permission, you must request it. For more information, see Request Data Source Permissions.
Procedure
In the top menu bar of the Dataphin homepage, choose Develop > Data Integration.
In the top menu bar of the Data Integration page, select a Project. In Dev-Prod mode, you must also select an environment.
In the navigation pane on the left, click Batch Pipeline. In the Batch Pipeline list, click the offline pipeline that you want to develop. The configuration page for the offline pipeline opens.
In the upper-right corner of the page, click Component Library to open the Component Library panel.
In the navigation pane on the left of the Component Library panel, click Input. In the input component list on the right, find the AnalyticDB for MySQL 3.0 component and drag it onto the canvas.
Click the
icon in the AnalyticDB for MySQL 3.0 input component card to open the AnalyticDB for MySQL 3.0 Input Configuration dialog box.In the AnalyticDB for MySQL 3.0 Input Configuration dialog box, configure the parameters.
Parameter
Description
Step Name
The name of the AnalyticDB for MySQL 3.0 input component. Dataphin generates a step name automatically. You can change it based on your business scenario. Naming rules:
Use only Chinese characters, letters, underscores (_), and digits.
Do not exceed 64 characters.
Datasource
The drop-down list shows all AnalyticDB for MySQL 3.0 data sources. This includes data sources for which you have read-through permission and those for which you do not. Click the
icon to copy the current data source name.If you do not have read-through permission for a data source, click Request next to the data source to request read-through permission. For more information, see Request Data Source Permissions.
If you do not have an AnalyticDB for MySQL 3.0 data source, click New Datasource to create one. For more information, see Create an AnalyticDB for MySQL 3.0 Data Source.
Time Zone
Time format data is processed according to the current time zone. By default, this matches the time zone configured for the selected data source. You cannot change this setting.
NoteFor tasks created before version V5.1.2, you can choose Data Source Default Configuration or Channel Configuration Time Zone. The default selection is Channel Configuration Time Zone.
Data Source Default Configuration: 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.
Source Table Count
Select the number of source tables. Options are Single Table and Multiple Tables:
Single Table: Use this option when syncing business data from one source table to one destination table.
Multiple Tables: Use this option when syncing business data from multiple source tables to one destination table. When writing data from multiple tables into one destination table, the system uses the union algorithm.
Table Matching Method
Select Generic Rule or Database Regex.
NoteThis parameter is available only when you select Multiple Tables for Source Table Count.
Table
Select the source table:
If you select Single Table for Source Table Count, search by entering a keyword in the table name field. 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.If you select Multiple Tables for Source Table Count, enter an expression based on the selected table matching method.
If you select Generic Rule for table matching: Enter a table expression in the field to filter tables with the same structure. The system supports enumeration, regex-like syntax, and mixed formats. For example:
table_[001-100];table_102;.If you select Database Regex for table matching: Enter a regular expression supported by the current database. The system matches tables in the destination database using this regex. During task runtime, new tables are matched dynamically based on the regex.
After entering the expression, click Exact Search. In the Confirm Match Details dialog box, view the list of matched tables.
Split Key (Optional)
The system partitions data based on the split key column you specify. Use this with concurrency settings to enable concurrent reads. You can use any column from the source data table as the split key. For best performance, use a primary key or an indexed column.
ImportantIf you select a date-time type, the system performs brute-force partitioning across the full time range and concurrency level. This does not guarantee even distribution.
Input Filter (Optional)
Enter filter conditions for input fields. For example:
ds=${bizdate}. Input filters apply in these scenarios:A fixed subset of data.
Parameter-based filtering.
Output Fields
This section lists all fields from the selected table and filtered by your conditions. You can perform the following actions:
Field Management: To exclude some fields from downstream components, delete them:
Delete individual fields: To delete a few fields, click the
icon in the Actions column.Delete multiple fields: To delete many fields, click Field Management. In the Field Management dialog box, select multiple fields. Click the left-shift icon
to move selected input fields to the unselected list. Click OK to complete the batch deletion.
Batch Add: Click Batch Add to add fields in JSON, TEXT, or DDL format.
NoteAfter batch adding, clicking OK overwrites existing field configurations.
A batch configuration in JSON format, for 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" }]Noteindexspecifies the 0-based column index of the object,namespecifies the name of the field after import, andtypespecifies the data type of the field after import. For example,"index":3,"name":"user_id","type":"String"indicates that the fourth column of the file is imported with the field nameuser_idand the data typeString.You can batch configure settings in TEXT format, for example:
// Example: 1,id,int(10),Long,comment1 2,user_name,varchar(255),Long,comment2The row delimiter separates field entries. By default, it is a line feed (\n). You can also use a semicolon (;) or period (.).
The column delimiter separates field names and types. By default, it is a comma (,). You can also use
','. Field types are optional. The default value is','.
Configure multiple objects at once in DDL format, such as:
CREATE TABLE tablename ( user_id serial, username VARCHAR(50), password VARCHAR(50), email VARCHAR (255), created_on TIMESTAMP, );
Add a New Output Field: Click + Add Output Field. Fill in Column, Type, Comment, and select a Mapping Type. Click the
icon to save the row.
Click OK to finish configuring the AnalyticDB for MySQL 3.0 input component.