Configure the YashanDB source component
After you configure the YashanDB source component, you can read data from a YashanDB data source into Dataphin for data integration and data development.
Prerequisites
-
A YashanDB data source has been created. For more information, see Create a YashanDB data source.
-
The account used to configure the YashanDB source component must have sync read permissions on the data source.
Procedure
-
In the top navigation bar of the Dataphin homepage, choose Develop > data integration.
-
In the top navigation bar of the data integration page, select a project. In Dev-Prod mode, you must also select an environment.
-
In the left-side navigation pane, click batch integration. From the batch integration list, click the desired 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 left-side navigation pane of the component library panel, select Source. From the list of source components on the right, find the YashanDB component and drag it onto the canvas.
-
On the YashanDB source component card, click the
icon to open the YashanDB Input Configuration dialog box. -
In the YashanDB Input Configuration dialog box, configure the parameters.
Parameter
Description
Step name
The name of the YashanDB source component. Dataphin automatically generates a step name, which you can change based on your business needs. The name must follow these rules:
-
Can contain only Chinese characters, letters, underscores (_), and digits.
-
Must not exceed 64 characters.
Data source
In the drop-down list, select the YashanDB data source. This list displays all YashanDB-type data sources in Dataphin, regardless of whether you have sync read permissions. Click the
icon to copy the name of the selected data source.-
If you do not have sync read permissions for a data source, click the Apply link next to it to request them. For more information, see Apply for, renew, and revoke data source permissions.
-
If you do not have a YashanDB-type data source, click Create Data Source to create one. For more information, see Create a YashanDB data source.
Time Zone
Specifies the time zone for processing time-formatted data. This parameter defaults to the time zone of the selected data source and cannot be changed.
Schema (Optional)
Select the schema of the source table. If you do not specify a schema, the default schema from the data source is used.
Table
Select the source table. You can search by keyword, or enter the exact table name and then click Exact Search. Click the
icon to copy the name of the selected table.Shard key (Optional)
Specifies the shard key for partitioning data, which enables parallel reads when used with the concurrency setting. The column used for the shard key must be an integer or date/time type. Using other data types may result in inaccurate sharding.
Note-
If you select a date/time column, Dataphin splits the data by range, dividing the interval between the minimum and maximum values based on the concurrency level. This method does not guarantee an even distribution.
-
In YashanDB,
NUMBERinteger columns are reported as theNUMERICorDECIMALtype, both of which are supported as integer shard keys.
Encoding (Optional)
Select the character set encoding for reading data. Supported values are UTF-8, GBK, and ISO-8859-1. The default value is empty.
Fetch size (Optional)
A larger fetch size, such as 1024, can improve performance by reducing network round-trips and I/O operations.
Filter condition (Optional)
Enter the filter condition for the input field. For example,
ds=${bizdate}. The filter condition applies to the following two scenarios:-
Static data: Retrieve a fixed subset of data.
-
Parameter-based filtering: Dynamically filter data by using parameters.
NoteWhen you enter the filter condition, enter only the content that follows the
WHEREkeyword. Do not include theWHEREkeyword. The conditional expression must use a syntax supported by YashanDB and can include system global variables, such as the business date${bizdate}.Output fields
The output fields section displays all fields from the selected table that match the filter condition. You can perform the following operations:
-
Field management: To prevent specific fields from being passed to downstream components, remove them as follows:
-
To remove a single field: Click the
icon in the Actions column to remove an unnecessary field. -
To remove fields in bulk: Click Field Management. In the Field Management dialog box, select multiple fields, click the
left arrow icon to move the selected fields to the unselected list, and then click OK.
-
-
Batch add: Click Batch Add to configure fields in a batch by using the
JSON,TEXT, orDDLformat. After the batch addition is complete, clicking OK will overwrite the existing field information.-
Configure settings in batches in
JSONformat. 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 source data,namespecifies the name for the imported field, andtypespecifies the data type for the imported field. For example,"index":3,"name":"user_id","type":"String"indicates that the fourth column of the file is imported, the field name is user_id, and the field type is String. -
Batch configure in
TEXTformat. For example:// Example: 1,id,int(10),Long,comment1 2,user_name,varchar(255),Long,comment2-
A row delimiter is used to separate the information in each field. The default is the newline character (
\n). Supported delimiters include the newline character (\n), a semicolon (;), and a period (.). -
The column separator is used to separate field names and field types, and the default is a comma (
,).
-
-
To configure in DDL format, use the following example:
CREATE TABLE tablename ( user_id INT, user_name VARCHAR(50), created_on TIMESTAMP );
-
-
Add output field: Click Add Output Field and follow the prompts to enter a Field, Type, and Comment, and select a Mapping Type. After you configure the row, click the
icon to save.
-
-
Click Confirm to save the configuration.
icon to save.