Help Center/ DataArts Studio/ FAQs/ DataArts Migration/ What Can I Do If the Map Field Tab Page Cannot Display All Columns?
Updated on 2023-03-01 GMT+08:00

What Can I Do If the Map Field Tab Page Cannot Display All Columns?

Symptom

When data is exported from HBase/CloudTable using CDM, fields in the HBase/CloudTable table on the Map Field tab page occasionally cannot be displayed completely and cannot match the fields on the migration destination. As a result, the data imported to the migration destination is incomplete.

Possible Cause

HBase/CloudTable are schema-less, and the number of columns in each data is not fixed. On the Map Field page, there is a high probability that all columns cannot be obtained by obtaining example values. In this case, the data on the migration destination is incomplete after the job is executed.

To solve this problem, perform any of the following methods:
  1. Add fields on the Map Field tab page.
  2. Edit the JSON file of the job on the Job Management page (modify the fromJobConfig.columns and toJobConfig.columnList parameters).
  3. Export the JSON file of the job to the local PC, modify the parameters in the JSON file (the principle is the same to that in 2), and then import the JSON file back to CDM.

You are advised to perform 1. The following uses data migration from HBase to DWS as an example.

Solution 1: Adding Fields on the Map Field Tab Page

  1. Obtain all fields in the tables to be migrated from source HBase. Use colons (:) to separate column families and columns. The following gives an example:
    rowkey:rowkey
    g:DAY_COUNT
    g:CATEGORY_ID
    g:CATEGORY_NAME
    g:FIND_TIME
    g:UPLOAD_PEOPLE
    g:ID
    g:INFOMATION_ID
    g:TITLE
    g:COORDINATE_X
    g:COORDINATE_Y
    g:COORDINATE_Z
    g:CONTENT
    g:IMAGES
    g:STATE
  2. On the Job Management page, locate the job for exporting data from HBase to DWS, click Edit in the row where the job resides, and go to the Map Field tab page.
    Figure 1 Field mapping 03
  3. Click . In the dialog box that is displayed, select Add a new field.
    Figure 2 Adding a field 04
    • After a field is added, the example value of the new field is not displayed on the console. This does not affect the transmission of field values. CDM directly writes the field values to the migration destination.
    • To add new fields, the migration source must be MongoDB, HBase, relational databases, or Redis (data in Redis must be in the Hash format).
  4. After all fields are added, check whether the mapping between the migration source and destination is correct. If the mapping is incorrect, drag the fields to adjust the field mapping.
  5. Click Next and Save.

Solution 2: Modifying a JSON File

  1. Obtain all fields in the tables to be migrated from source HBase. Use colons (:) to separate column families and columns. The following gives an example:
    rowkey:rowkey
    g:DAY_COUNT
    g:CATEGORY_ID
    g:CATEGORY_NAME
    g:FIND_TIME
    g:UPLOAD_PEOPLE
    g:ID
    g:INFOMATION_ID
    g:TITLE
    g:COORDINATE_X
    g:COORDINATE_Y
    g:COORDINATE_Z
    g:CONTENT
    g:IMAGES
    g:STATE
  2. In the DWS destination table, obtain the fields corresponding to the HBase table fields.
    If any field name corresponding to the HBase field does not exist in the DWS destination table, add it to the DWS table schema. Suppose that the fields in the DWS table are complete and are displayed as follows:
    rowkey
    day_count
    category
    category_name
    find_time
    upload_people
    id
    information_id
    title
    coordinate_x
    coordinate_y
    coordinate_z
    content
    images
    state
  3. On the Job Management page, locate the job for exporting data from HBase to DWS, and choose More > Edit Job JSON in the row where the job resides.
  4. On the page that is displayed, edit the JSON file of the job.
    1. Modify the fromJobConfig.columns parameter of the migration source to the HBase fields obtained in 1. Use & to separate column numbers and colons (:) to separate column families and columns. The following gives an example:
      "from-config-values": {
                      "configs": [
                          {
                              "inputs": [
                                  {
                                      "name": "fromJobConfig.table",
                                      "value": "HBase"
                                  },
                                  {
                                      "name": "fromJobConfig.columns",
                                      "value": "rowkey:rowkey&g:DAY_COUNT&g:CATEGORY_ID&g:CATEGORY_NAME&g:FIND_TIME&g:UPLOAD_PEOPLE&g:ID&g:INFOMATION_ID&g:TITLE&g:COORDINATE_X&g:COORDINATE_Y&g:COORDINATE_Z&g:CONTENT&g:IMAGES&g:STATE"
                                  },
                                  {
                                      "name": "fromJobConfig.formats",
                                      "value": {
                                          "2": "yyyy-MM-dd",
                                          "undefined": "yyyy-MM-dd"
                                      }
                                  }
                              ],
                              "name": "fromJobConfig"
                          }
                      ]
                  }
    2. Modify the toJobConfig.columnList parameter of the migration source to the field list of DWS obtained in 2.
      The sequence must be the same as that of HBase to ensure correct field mapping. Use & to separate field names. The following gives an example:
      "to-config-values": {
                      "configs": [
                          {
                              "inputs": [
                                  {
                                      "name": "toJobConfig.schemaName",
                                      "value": "dbadmin"
                                  },
                                  {
                                      "name": "toJobConfig.tablePreparation",
                                      "value": "DO_NOTHING"
                                  },
                                  {
                                      "name": "toJobConfig.tableName",
                                      "value": "DWS "
                                  },
                                  {
                                      "name": "toJobConfig.columnList",
                                      "value": "rowkey&day_count&category&category_name&find_time&upload_people&id&information_id&title&coordinate_x&coordinate_y&coordinate_z&content&images&state"
                                  },
                                  {
                                      "name": "toJobConfig.shouldClearTable",
                                      "value": "true"
                                  }
                              ],
                              "name": "toJobConfig"
                          }
                      ]
                  }
    3. Retain the settings of other parameters, and then click Save and Run.
  5. After the job is completed, check whether the data in the DWS table matches the data in HBase. If the mapping is incorrect, check whether the sequences of the HBase and DWS fields in the JSON file are the same.