Create and manage standard codes (lookup tables)

更新时间:
复制 MD 格式

Lookup tables, also known as data dictionaries, store the mapping between enumeration data names and codes. You can use them to constrain the value range of standard properties.

5-minute overview

Permission description

  • Super administrators and data standard administrators can create and manage all lookup tables, lookup table directories, and import template libraries.

  • Data standard set maintainers can edit or delete lookup tables they have joined.

Limits

  • Lookup table directories cannot exceed 10 levels.

  • The total number of lookup table directories across all levels cannot exceed 1,000.

  • Each lookup table can contain a maximum of 10,000 code values, which must be unique within the table.

Lookup table list

The lookup table list supports two display modes: Edit and View. On the Reference Tables page, click the icon in the upper-right corner image to switch between modes.

In View mode, you can browse lookup table directories and their information, but cannot perform operations.

In Edit mode, you can view references, edit, export, and delete lookup tables and directories. This mode is accessible only to users with lookup table management permissions.

  1. On the Reference Tables list page, the left-side directory classifies and manages lookup tables from a business or organizational perspective. Selecting a directory level displays the corresponding lookup tables on the right, including name, directory, description, status, definition method, code value count, owner, and last updated by/time. Click All Lookup Tables to view all lookup tables.

  2. (Optional) Search for lookup tables by name or code, or filter by directory, owner, etc.

  3. Perform the following operations on the selected lookup table directory or table:

    Operation Item

    Description

    Lookup Table Directory

    Create Lookup Table

    Click the Create Lookup Table icon next to a directory to create a new lookup table in that directory. In the All Lookup Tables directory, the new table is added directly.

    Import Lookup Table from Template Library

    Click the Import lookup table from template library icon to the right of the directory row, or hover over the create lookup table button and select Import lookup table from template library from the dropdown menu.

    Lookup Table List

    View Details

    Click View Details in the operation column to view lookup table details and reference information.

    Edit

    Click Edit in the operation column to modify the lookup table configuration.

    If you change the definition method, source table, or fields, the existing configuration is updated only after data retrieval succeeds and the changes are saved and published. Otherwise, the existing configuration is retained.

    Export

    Click Export in the operation column, or select lookup tables from the list and click Batch Export at the bottom to export lookup table and code value information as an Excel file. For details, see Batch Import and Export Lookup Table.

    Update Code Values

    Available only when the definition method is "Import from Table." Click More in the operation column and select Update Code Values. The system retrieves the latest code value data based on the import configuration. After successful retrieval, save and publish to update the code value configuration.

    Edit Code Values

    Available only when the definition method is "Import from Table." Click More in the operation column and select Edit Code Values to directly modify code value definitions.

    View References

    Click More in the operation column and select View References to see which standard templates reference this lookup table. Click a Standard Template name to view its property information, references, and historical versions.

    Delete

    Click More in the operation column and select Delete. Deletion is irreversible; proceed with caution.

Manage lookup table directory

  1. Navigate to the Dataphin home page, select Administration > Standard from the top menu bar.

  2. In the navigation pane on the left, choose Reference Data > Standard Codes (Lookup Table). On the Lookup Table Directory tab, click the Edit icon.

  3. In the Lookup Table Directory Management panel, you can create, move, edit, and delete lookup table directories.

    Operation

    Description

    Create

    Enter a folder name that is unique at its level. The name must be 128 characters or less and cannot contain the forward slash (/) character.

    You can add new folders under a parent folder. If you do not select a parent folder, the new folder is placed in the root directory of the lookup table.

    Edit

    Changes the name of a folder.

    Move

    Moves the folder to a different parent folder.

    Delete

    A folder cannot be deleted if it contains subdirectories or lookup tables.

Create lookup table

  1. On the Reference Tables list page, click the + Create Lookup Table button.

  2. In the Create Custom Lookup Table dialog box, fill in the required parameters.

    Parameter

    Description

    Lookup Table Name

    The lookup table name. Must be unique within the parent folder. Maximum 128 characters. Example: National Region Code Table.

    Lookup Table Code

    A unique identifier for the lookup table. Maximum 128 characters. Supports letters, numbers, and half-width symbols. Example: DQ001.

    Directory

    The directory for the lookup table. If you are already in a lookup table directory, that directory is automatically selected. If no directory is chosen, the lookup table defaults to the root directory. To create a new directory, see Manage lookup table directory.

    Owner

    Select an owner for the lookup table from the user list.

    Description

    Describe the lookup table's purpose and scope. Maximum 1,000 characters.

    Code Information

    Two definition methods are supported: Custom and Import From Table.

    Custom create lookup table

    Fill in the information for the lookup table. You can also edit and delete the code information. Click the Add Code Value button to add more code values. You can also click the Batch Entry button to add code values in batches, or click the Delete All button to clear all code values.

    Batch Entry: In the Batch Entry dialog box, you can enter or paste code value information. The system parses a maximum of 10,000 rows. Each row is parsed for the code value, code name, English code name, and code description in sequence. Use a tab character (\t) or a space character (\s) to separate parameters, which are columns. Use a line feed character (\n) or Shift+Enter to start a new line.

    Example entry: Code value: 2900, Code name: Shanghai City, Code English name: Shanghai, Code description: Identifies Shanghai City.

    • Code Value: Required. Must be unique within the lookup table. Maximum 64 characters.

    • Code Name: Required. Maximum 64 characters.

    • Code English Name: Optional. Maximum 64 characters. Supports uppercase and lowercase English letters, numbers, and the following special characters:

      Parentheses (), bitwise operators (^, ~), backtick (`), exclamation point (!), at sign (@), number sign (#), dollar sign ($), percent sign (%), ampersand (&), asterisk (*), underscore (_), plus sign (+), backslash (\), minus sign (-), equal sign (=), square brackets ([]), curly braces ({}), vertical bar (|), semicolon (;), single quotation mark ('), colon (:), double quotation mark ("), comma (,), period (.), forward slash (/), angle brackets (<>), middle dot (·), and question mark (?).

    • Code Description: Optional. Accepts up to 256 characters.

    Click Save And Publish to complete the creation of the lookup table.

    Import from table

    Note
    • When retrieving code value data, the system does not apply row-level permissions or desensitized queries. Select data sources that are publicly accessible.

    • Using partitioned tables with the "Import from Table" definition method is not recommended. If necessary, use tables where each partition stores the full data.

    • Each lookup table supports a maximum of 10,000 code values, so only the first 10,000 matching records are queried.

    • The operator must have SELECT permission on the selected source table fields.

    • The system automatically converts source table data to string type for storage. If the code name or code value source field type cannot be converted, the entire record fails to be added. If the English name or description source field cannot be converted, the corresponding field is left empty without affecting the rest of the record.

    Reference data tables to quickly create lookup tables and reduce configuration overhead.

    1. In the code information area, configure the following information.

      • Source Table (Required): Supports referencing Dataphin tables (except meta tables and image tables) and data source tables that support Data Preview. You can perform fuzzy searches based on table full name or table description, or click the filter icon to quickly filter the required data tables by module/project/data source or table type.

      • Code Value (Required): Select a field from the source table. Code values must be unique within the lookup table. If the source field values are duplicated, the system automatically retrieves the data corresponding to the first record. If the source data exceeds 64 characters, the entire record fails to be added.

      • Code Name (Required): Select a field from the source table. If the source data exceeds 64 characters, the entire record fails to be added.

      • Code English Name (Optional): Select a field from the source table. Supports uppercase and lowercase English letters, numbers, and special characters. If the source data exceeds 64 characters, the system automatically truncates it or leaves the field empty.

        The supported special characters are:

        Parentheses (), bitwise operators (^, ~), backtick (`), exclamation point (!), at sign (@), number sign (#), dollar sign ($), percent sign (%), ampersand (&), asterisk (*), underscore (_), plus sign (+), backslash (\), minus sign (-), equal sign (=), square brackets ([]), curly braces ({}), vertical bar (|), semicolon (;), single quotation mark ('), colon (:), double quotation mark ("), comma (,), period (.), forward slash (/), angle brackets (<>), middle dot (·), and question mark (?).

      • Code Description (Optional): Select a field from the source table. If the source data exceeds 256 characters, the system automatically truncates or leaves it empty.

      • Data Filtering (Optional): Supports filtering source data by adding filter conditions such as partitions, null values, or duplicate values based on the selected table fields. When the table is a MaxCompute computing source table or Dataphin logical table, the system automatically enables and populates partition filter conditions. For other source types, you can enable this as needed.

    2. After completing the configuration, click the Preview Data button to verify the parameters, permissions, and syntax.

      • Parameters: Verifies that all required parameters are provided.

      • Permissions: Verifies that the operator has permission to create lookup tables.

      • Filter Conditions: Verifies that the filter condition syntax is correct.

    3. After verification passes, retrieve the lookup table data to add the lookup table to Dataphin.

      • While data is being retrieved, you can click Cancel or close the dialog box to terminate the query. The configured data will not be saved. Clicking Previous returns to the previous step and terminates the query. You must retrieve the data again.

      • If data retrieval fails, click Retry to try again, or click View Log to see the failure reason.

      • After successful retrieval, preview the code values and click Save And Publish to add the lookup table to Dataphin. If some records fail, an exception list shows the specific reasons.

What to do next

After creating a lookup table, you can use it to set value constraints for properties in standard templates. For more information, see Create and manage standard templates.