Data Synchronization - Data Destination and Mapping

  • Last update: December 06, 2024
  • Overview

    Version

    FineDataLink VersionFunctional Change
    4.1.11.5If the data source configuration method was set to Table Selection and the source table included a primary key, the primary key field would be synchronized as the primary key in the target table automatically during field mapping with Not Null ticked when Auto Created Table was selected as Target Table. For details, see the "Primary Key" section of this document.
    4.1.12.3If Auto Created Table was selected as Target Table, after the scheduled task ran successfully, the target table was still displayed as Auto Created Table.
    4.1.14.1
    • Allowed creating, deleting, and renaming fields in the target table.

    • Allowed modifying the type, length, and precision of fields in the target table.

    • Allowed configuring Not NullPrimary Key, and Remark for the target table. For details, see Synchronizing DDL Changes Using Scheduled Task

    4.2.0.2Field remarks were obtained during field mapping if the source table was in the Doris database of versions later than 2.1.6.

    Function Description

    This document introduces the configuration items on the Data Destination and Mapping tab page of the Data Synchronization node or the DB Table Output operator in the Data Transformation node.

    The Data Destination and Mapping tab page is shown in the following figure.

    iconNote:
    Some data sources provide limited support for Data Destination and Mapping. For details, see Functional Limitations of Different Data Sources.

    Configuring the Data Destination

    Data Source/Database

    Select where to write the data. For details about the supported data sources, see the "Types of Data Sources Supported by Scheduled Task" section of Data Sources Supported by FineDataLink.

    The drop-down list of Data Source only contains the data sources connected via data connections on which you have Use permission.

    You can select the schema (if any) in the database, as shown in the following figure.

    The default value of Schema is explained as follows.

    SchemaDescription
    Database with a schema
    • If Schema is configured in the data connection, the default value is the one set in the data connection. 

    • If Schema is not configured in the data connection, the value defaults to empty. Select the schema from the drop-down list. 

    Database without a schemaIf Database Name is set in the data connection, the value of Database defaults to that database name. Otherwise, the value defaults to empty.

    iconNote:

    1. The Schema setting item appears only when you select a relational database.

    2. If you set Target Table to Existing Table, the right drop-down list displays tables in the target database/schema. If you set Target Table to Auto Created Table, the table will be created in the target database/schema.

    Target Table

    iconNote:
    For FineDataLink 4.1.12.3 and later versions, if you set Target Table to Auto Created Table, after the scheduled task runs successfully, the target table is still displayed as Auto Created Table.

    FunctionDescription
    Auto Created Table

    Create a table in the target database to store the data. 

    iconNote: 

    1. Table names in versions prior to 4.1.6.1 can contain English letters, numbers, and underscores. Chinese characters are additionally supported in FineDataLink 4.1.6.1 and later versions.

    2. You need to select the table type when writing data into the Doris or StarRocks database. These two data sources provide limited support for Write Method. For details, see Doris Instruction and StarRocks Instruction

    Existing Table

    Select an existing table in the target database to store the data.

    iconNote:
    You need to select the table type when writing data into the Doris or StarRocks database. These two data sources provide limited support for Write Method. For details, see Doris Instruction and StarRocks Instruction

    Table Description

    iconNote: 
    The table description is written into the target database when the target table is successfully created, and remains unchanged after that. Manual changes to the table description are not included in DDL changes.

    1. If you set Target Table to Existing Table, the description of the existing table is displayed. 

    2. If you set Target Table to Auto Created Table, the table description defaults to empty and can be customized. 

    Requirements of the table description are as follows:

    • It is empty by default and not mandatory. 

    • You can enter numbers, letters, special characters, and Chinese characters.

    • The maximum length is 500 characters.

    3. Databases that do not support Table Description include ClickHouse, Hive, Impala, Transwarp Inceptor, Informix, MaxCompute, SQLite, and StarRocks.

    DDL Change Detection

    Table Field Mapping

    Establish the mapping relationship between source and target fields. 

    iconNote:

    1. Starting from FineDataLink 4.1.3, when writing data into an auto-created table in the Hive or Transwarp Inceptor data source, you can select specific fields in the target table as partition keys. For details, see Partition Table Creation and Data Reading/Writing

    2. Starting from FineDataLink 4.1.9.3, you can modify the field mapping rules of data sources in General Configuration. For details, see General Configuration - Field Mapping Rule

    Mapping Method

    Select the method to map source and target fields. Options include Map Fields with Same Name and Map Fields in Same Row.

    Mapping MethodMapping Logic
    Map Fields with Same Name

    Fields in the source and target tabled are matched by name similarity. The overall logic is as follows:

    1. The source field is mapped to the target field whose name is the same as that of the source field.

    2. If there is no such target field:

    • The source field is mapped to the target field whose name either contains the source field name or is included in the source field name.

    • Multiple target fields that meet the above condition are prioritized based on the order in which fields are listed. The field listed first has the highest priority and is displayed first during matching.

    • The field that has already been matched will not be matched again, so no N-to-1 mapping relationship exists between source and target fields.

    3. If there is no field in the target table whose name completely matches the source field name or includes the source field name, the target field of that source field will be left empty.

    Map Fields in Same Row

    The source field and the target field in the same row in the field mapping area are mapped. 

    This method applies to scenarios where the order of the source field matches that of the target field.

    Manual Table Creation

    The Manual Table Creation button is displayed only when you set Target Table to Auto Created Table.

    After clicking Manual Table Creation, you can modify the field name and type and define various table attributes. 

    1. You can view and modify the table creation statement. 

    • You can re-obtain the table creation statement, which is equal to resetting the statement.

    • Your changes to the table creation statement do not affect the configuration in the field mapping area.

    2. You can click Start Table Creation after modifying the statement. After the table is successfully created in the database, the target table is displayed as an existing table.

    3. The configuration in the Manual Table Creation window does not take effect when the task is running. You need to click Start Table Creation. After the table is created successfully, review the configuration and ensure it aligns with the logic of the existing table.

    Editing the Mapping

    iconNote:

    1. The source field to be written into the target table must be configured with the mapping relationship. That is, its target field cannot be empty.

    2. To write only specific source fields into the target table, you can cancel the mapping for unnecessary fields or use the Field Setting operator to delete unnecessary fields. The unmapped source fields will not be written into the target table nor affect other fields.

    1. You can perform the following operations on the target field.

    • Unmap a field.

    • Reorder fields.

    • Modify the field type and name.

    • Set the primary key. Enable Not Null.

    2. You can customize the mapping relationship between the source and target fields. 

    Reobtaining the Mapping

    You can click the Reobtain button to refresh the field mapping relationship when the field or field type of the source table changes, which will reset the configuration in the field mapping area.

    Primary Key

    If you set Target Table to Auto Created Table on the Data Destination and Mapping tab page, you can set the primary key in the field mapping area.

    iconNote:
    For the auto-created table without a primary key set, after the task is executed and the table is created successfully, you cannot modify the primary key when editing the task.

    iconNote:
    Hive and Transwarp Inceptor data sources do not support the setting of physical primary keys and primary key identifier columns. 

    If the data source configuration method is set to Table Selection and the source table contains a primary key, the primary key field will be synchronized as the primary key in the target table automatically during field mapping with Not Null ticked when Auto Created Table is selected as Target Table, as shown in the following figure.

    Target Table StatusSource TableSynchronizing Primary Key and Not Null Setting Automatically 
    The target table supports physical and logical primary keys.The source table supports the primary key.Yes
    The target table supports the logical primary key, but not the physical primary key.The source table supports the primary key.Yes
    The target table does not support the primary key.The source table supports the primary key.No

    Filtering the Target Field

    You can filter target fields to obtain mapped/unmapped fields and error-free/error fields (such as fields with empty names or types). 

    Synchronizing the Field Remark

    iconNote:

    1. Databases that do not support the reading or writing of the field remark include Hive, Impala, Transwarp Inceptor, Informix, MaxCompute, SQLite, and StarRocks.

    2. The field remark is written into the target database when the target table is successfully created, and remains unchanged after that. Manual changes to the field remark are not included in DDL changes.

    Synchronizing the remark of the source field to the target table is supported. If you set Target Table to Auto Created Table, you can customize the remark of the target field.

    1. The Remark column of the source table is explained as follows.

    If the data source configuration method is set to Table Selection, the remark of the source field is obtained automatically and displayed in the field mapping area on the Data Destination and Mapping tab page. 

    Otherwise, the value of the Remark column is --

    2. The Remark column of the target table is explained as follows.

    If you set Target Table to Existing Table, the Remark column displays the remark of fields in the existing table, which cannot be modified.

    If you set Target Table to Auto Created Table, you can customize the field remark. 

    Requirements of the field remark are as follows:

    • It is empty by default and not mandatory.

    • You can enter numbers, letters, special characters, and Chinese characters. 

    • The maximum length is 30 characters.

    Updating the Target Table

    You can process target fields in the task to update the target table structure when DDL changes occur in the source table For details, see Synchronizing DDL Changes Using Scheduled Task.

    Notes

    Pay attention that:

    1. If you delete some source fields and switch the mapping method, the mapping relationship will be adjusted only for the remaining fields.

    2. To obtain the matching result of mapping fields in the same row, switch the mapping method from the default Map Fields with Same Name to Map Fields in Same Row and click the Reobtain button.

    3. There may be no matching target field in the following two scenarios. In these cases, the target field on the right is empty.

    • Map Fields with Same Name is selected, and the target table does not contain fields whose names contain the names of the source fields.

    • Map Fields in Same Row is selected, and the number of source fields exceeds the number of target fields.

    4. During mapping, if a target field has a null value, a warning icon will appear. When you hover the cursor over it, a prompt will appear, saying, "A null value exists in the Target Table field."

    5. After a scheduled task is executed, the field type of the target table cannot be modified in the field mapping area.


    附件列表


    主题: Data Development - Scheduled Task
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy