Managing Lookup Tables
A lookup table, also called data dictionary table, consists of enumerable data names and codes. It stores the relationships between enumeration data names and codes. A lookup table:
- Standardizes business data and supplement mapping fields during data cleaning.
- Monitors the value range of the business data during data quality monitoring.
- Enumerates dimensions during dimensional modeling.
Creating and Publishing a Lookup Table
Manually create a lookup table. You can also add table records after creating a lookup table. For details, see Filling in a Lookup Table.
- Log in to the DGC console, select a DGC instance, and click Access.
On the displayed page, click the Workspaces tab. In the workspace list, locate the required workspace.
- Click Data Design of the corresponding workspace to access the Data Design console.
- Choose Lookup Tables from the left navigation bar.
- Select a directory from the directory tree on the Lookup Tables page, and then click
to create a directory under the selected directory. When creating a directory for the first time, you can create a directory under the root directory. Figure 1 Lookup Tables page
- In the displayed dialog box, set the parameters as prompted and click OK. Figure 2 Create Directory dialog box
Table 1 Parameters Parameter
Description
Directory Name
Only letters, digits, and underscores (_) are allowed.
Select Directory
Select an existing directory, and create a sub-directory under it.
- Select the directory you created in the directory tree and click Create to create a lookup table.
- On the Create Lookup Table page, configure the parameters.
In the Basic Settings area, set the parameters described in the figure below:
Figure 3 Basic Settings tab
Table 2 Parameters Parameter
Description
Table Name
The name of the lookup table to be created. Only letters, digits, brackets, spaces, hyphens (-) and underscores (_) are allowed. Table names must start with letters.
Table Code
The code of the lookup table to be created. The code can include letters, numbers, spaces, colons (:), underscores (_), hyphens (-), parentheses, slashes (/), and ampersands (&) and cannot start with a space, <, >, or /.
Description
A description of the lookup table. Up to 600 characters are supported.
In the Field Inputs area, click Add or
to add new fields, and
to delete unnecessary fields.Figure 4 Field Inputs tab
- Click Publish. In the displayed Apply for Publication dialog box, select a reviewer and click OK. After the application is approved, the Lookup Tables page is displayed. You can view the created lookup table in the list, and the status of the table is Published. Only published lookup tables can be used.
If the current user has been added as a reviewer, you can select Auto-review and click OK. After the application is approved, the lookup table status changes to Published.
Filling in a Lookup Table
Input values in the created lookup tables.
- On the Data Design console, choose Lookup Tables from the left navigation bar.
- In the list of lookup tables, find the target table and choose More > Value Input in the Operation column.
- On the page that is displayed, click Add. In the dialog box that is displayed, set parameters. Figure 5 Inputting a value
- Click OK. You can also click Continue to add additional records.
Importing a Lookup
When importing a lookup table, ensure that the table name contains a maximum of 32 characters.
You can import a new lookup table or import lookup table records in batches from an existing lookup table. If you have a large number of lookup table records, you are advised to import them in batches.
- On the Data Design console, choose Lookup Tables from the left navigation bar.
- On the displayed page, select a directory, and choose More > Import. You can also right-click the selected directory and choose Import from the shortcut menu. Figure 6 Lookup Tables page
- In the Import Lookup Table dialog box, set the parameters as prompt, and click Upload and Verify.
Table 3 Parameters for importing lookup tables Parameter
Description
Update Existing Table
Whether to update the existing lookup tables. When a lookup table is imported, the system checks whether the lookup table exists according to its code. The options are as follows:
- No: If you select this option, the existing lookup table will not be updated.
- Yes: If you select this option, the existing lookup table will be updated. If a lookup table is in the Published state, you need to publish the lookup table again after updating it so that the updated lookup table can take effect.
During the import, only lookup table creation and update are allowed.
Upload File
Select the file to be imported. You can use either of the following methods to obtain the file to be imported:
- Downloading the lookup table template and fill in it
In the Import Lookup Table dialog box, click Lookup Table Template to download the template, set parameters in the template as required, and save the settings. Refer to Table 4 for template parameter details.
Instructions for filling in the lookup table template:
- Parameters whose names start with * are mandatory, and those that do not start with * are optional.
- Multiple fields can be added to a lookup table.
- To import multiple lookup tables, you can add multiple sheets to the template file. The sheet name is the corresponding lookup table name.
- If the name of a lookup table already exists and Update Table is set to Yes, the existing lookup table will be updated during the import.
- If the table name does not exist, a lookup table with that name is created during the import.
- Exporting lookup tables to files
You can export the lookup tables created in Data Design of a DGC instance to Excel files in advance. Then, import the Excel files. For details on how to export lookup tables, see Managing a Lookup Table.
Table 4 Parameters Parameter
Description
Directory
The directory that a lookup table belongs to. Multi-level directories are separated with slashes (/), for example, dir01/dir02.
*Table Name
The name of the lookup table to be created. Only letters, digits, brackets, spaces, hyphens (-) and underscores (_) are allowed. Table names must start with letters.
*Table Code
The code of the lookup table to be created. Only letters, numbers, and underscores (_) are allowed. A table code must start with a letter.
Table Description
A description of the lookup table. Up to 600 characters are supported.
*Field Name
The name of a field. Only letters, digits, brackets, spaces, hyphens (-) and underscores (_) are allowed. Table names must start with letters.
*Field Code
The code of a field. Only letters, numbers, and underscores (_) are allowed. A table code must start with a letter.
*Field Data Type
The possible values are STRING, BIGINT, DOUBLE, TIMESTAMP, DATE, BOOLEAN, and DECIMAL.
Field Description
The supplementary information about a field. Up to 600 characters are supported.
Generate Standard
- true indicates to generate a data standard.
- false indicates not to generate a data standard. The default value is false.
If the lookup table records need to be imported, create a sheet named after the lookup table in the template and add table fields to the sheet. Each field occupies a column. The column name includes code and value. Enter the lookup table values to be imported. If the template contains a sheet named after the lookup table, you do not need to create the sheet. You can directly enter the table values to be imported in the sheet.
- You can view the import result on the Last Import tab page. If the import is successful, click Close. If the import fails, you can view the failure cause, correct the template file, and upload it again. Figure 7 Last Import tab page
Importing a Lookup Table Through a Reverse Database
With reverse databases, you can import one or more created database tables from other data sources into a lookup table directory to turn them into lookup tables.
- On the Data Design console, choose Lookup Tables from the left navigation bar.
- On the displayed page, select a directory and click Reverse Database above the lookup table list.
- In the Reverse Database dialog box, set the parameters described in the table below and click Yes.
Table 5 Parameters Parameter
Description
Data Connection Type
The data connection types supported by the reverse database are displayed in the drop-down list. Select the required data connection type.
Data Connection
Select a data connection.
If you want to reverse a database from other data sources to a lookup table directory, you need to create a data connection in DGC Management Center to connect to the data source. For details on how to create data connections, see Creating Data Connections.
Database
The name of the database. Select a database from the drop-down list.
Queue
DLI queue. This parameter is available only when Data Connection Type is set to DLI.
Update Table
When you reverse a table from another data source, if the name of the reversed table is the same as that of an existing table in lookup table list, you can select this option.
Reverse Table
- No: If you select this option, tables are imported to the lookup table directory but table data is not imported during database reverse. After reversing a database, you can add records to the lookup table. Refer to Filling in a Lookup Table for details.
- Overwrite: If you select this option, tables are imported to the lookup table directory and table data is imported as well during database reverse.
Data Table
You can select one or more data tables to be imported.
Figure 8 Reverse Database dialog box
- You can view the result in the Last Reverse tab page. If the reverse operation is successful, click Close. If the reverse operation fails, you can view the failure cause. After the fault is rectified, select the table again and click Reverse to retry. Figure 9 Last Reverse tab page
Exporting a Lookup Table
When exporting a lookup table, ensure that the table name contains a maximum of 32 characters.
- On the Data Design console, choose Lookup Tables from the left navigation bar.
- Export a lookup table
- Export a lookup table.
In the lookup table list, select the lookup table you want to export and choose More > Export.
Figure 10 Lookup table list
- Export all tables in the list.
Right-click a directory in the directory tree and choose Export from the shortcut menu.
Figure 11 Directories storing exported lookup tables
- Export a lookup table.
Deleting a Lookup Table
Deleted lookup tables cannot be recovered. Exercise caution when performing this operation. A lookup table that is to be published, has already been published, or to be suspended cannot be deleted. You can delete a lookup table only after the status of the lookup table changed.
- On the Data Design console, choose Lookup Tables from the left navigation bar.
- In the lookup table list, select the lookup table you want to delete and choose More > Delete above the list.
- In the displayed dialog box, click Yes to delete it.
Deleting a Lookup Table Directory
If a directory or its subdirectories contain a lookup table, the lookup table directory or the subdirectories cannot be deleted. You need to delete the lookup table before deleting the directory.
- On the Data Design console, choose Lookup Tables from the left navigation bar.
- On the displayed page, right-click the directory you want to delete and choose Delete from the shortcut menu. Figure 12 Managing lookup table directories
- In the displayed dialog box, click Yes to delete it.
Managing a Lookup Table
After a lookup table is created, you can search for, edit, or delete it.
On the Data Design console, choose Lookup Tables from the left navigation bar. You can manage the lookup tables as required.
- Edit
In the lookup table list, select a table you want to edit and click Edit in the Operation column.
- Publish
In the lookup table list, click Publish in a row where there is a table with the Draft or Rejected status, select a reviewer in the displayed dialog box, and click Confirm. After the application is approved, the lookup table is published.
- Suspend
In the lookup table list, select a published lookup table you want to suspend, click Suspend in the Operation column, select a reviewer in the displayed dialog box, and submit the application. If the application is approved, the lookup table is suspended.
Last Article: Designing Subjects
Next Article: Data Standards
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.