If you use a modeling tool to generate models and you want to use DataWorks Dimensional Modeling for subsequent modeling operations, you can use the reverse modeling feature provided by DataWorks Dimensional Modeling. The models can be dimension tables, fact tables, or aggregate tables. The reverse modeling feature allows you to import the models that are generated by using the modeling tool into a compute engine instance. The system creates models based on the imported models. This way, you do not need to manually create models in DataWorks Dimensional Modeling, and your time costs are reduced. This topic describes how to perform reverse modeling.

Prerequisites

  • The tables that are generated by using a modeling tool other than DataWorks Dimensional Modeling are imported into a MaxCompute compute engine instance. The MaxCompute compute engine instance is associated with your DataWorks workspace. For more information about how to associate a compute engine instance with a workspace, see Configure a workspace.
  • The workspace to which the imported tables belong is associated with a model design workspace. For more information, see Modeling workspace.
  • A data domain is created to determine the business type. For more information, see Data domain.
  • A business process is created to determine the specific business activity. For more information, see Business process.
  • A business category is created to determine the logical entity that you want to analyze. For more information, see Business category.

Limits

  • You can perform reverse modeling only on the tables that are imported into a MaxCompute compute engine instance in the production environment.
  • You can perform reverse modeling only on the tables that belong to workspaces associated with a model design workspace. Before you can perform reverse modeling on the tables that belong to a specific workspace, you must associate the workspace with a model design workspace. For more information, see Modeling workspace.
  • If a workspace has an ongoing reverse modeling task, you cannot start another reverse modeling task in the workspace until the existing task ends.

Reverse modeling process

The reverse modeling feature allows you to import the models that are generated by using a modeling tool into a compute engine instance. The system creates models based on the imported models. The following figure shows the overall reverse modeling process.Reverse modeling process
  1. Configure a reverse modeling policy.
    • Confirm information about the tables on which you want to perform reverse modeling based on your business requirements. The information includes workspaces to which the tables belong and the complete names of the tables.
    • Specify naming conventions and data warehousing levels for the tables to be created by the system based on your business requirements. Data warehousing levels include business process, data domain, and business category.
    • Specify whether to create all required tables or create only the tables that do not exist on the Dimensional Modeling page.
    Note A reverse modeling policy cannot be modified after it is created. We recommend that you plan a policy in advance based on your business requirements.
    For more information, see Configure a reverse modeling policy.
  2. The system generates tables.

    The system generates tables based on the configured reverse modeling policy.

  3. Confirm the information about the tables.

    The generated tables may not meet your business requirements. In this case, modify the information about the tables based on your business requirements. For example, you can change the data domain or business process of a table. For more information, see Confirm the information about tables.

  4. The system finalizes the tables.
    After reverse modeling is complete, you can view the types and numbers of the created tables. You can also check the error messages reported for tables that fail to be created and troubleshoot issues at the earliest opportunity.
    Note
    • The created tables are automatically published to the related MaxCompute compute engine instance. You do not need to manually publish the tables again.
    • You can manage the created tables on the Dimensional Modeling page. For more information, see Publish and manage a table.

Procedure

  1. Go to the Dimensional Modeling page.
  2. Go to the Reverse Modeling page.
    In the left-side navigation pane of the page that appears, click Reverse Modeling.
  3. Start reverse modeling.
    • If this is the first time you use the reverse modeling feature, click Start Now on the Reverse Modeling page.
    • If this is not the first time you use the reverse modeling feature, click Create in the upper-right corner of the Modeling Tasks page.
  4. Configure a reverse modeling policy.
    Note A reverse modeling policy cannot be modified after it is created. We recommend that you plan a policy in advance based on your business requirements.
    1. In the Create Reverse Policy step, configure the parameters.
      Configure a reverse modeling policy
      Parameter Description
      Workspace The DataWorks workspace to which the tables on which you want to perform reverse modeling belong.
      Note You can perform reverse modeling only on the tables that belong to workspaces associated with a model design workspace. Before you can perform reverse modeling on the tables that belong to a specific workspace, you must associate the workspace with a model design workspace. For more information, see Modeling workspace.
      Table Name Matching Rule Enter the names of the tables on which you want to perform reverse modeling.
      The system uses the names you enter to match tables in the workspace that you select from the Workspace drop-down list.
      • If tables with the same name are matched in the workspace, the system performs reverse modeling on the tables based on the execution mode you specify. The tables created by the system are displayed on the Dimensional Modeling page.
      • If no tables are matched in the workspace, reverse modeling fails, and no tables are created.
      Note
      • The Table Name Matching Rule can be set only to Exact Match. Therefore, you must enter the complete names of tables.
      • Separate multiple names with semicolons (;). Do not add spaces after semicolons.
      Table Naming Rule
      The rule that is used to parse the table names that you specify by using the Table Name Matching Rule parameter and standardize the names of tables to be created during reverse modeling. This way, the system can store the created tables at appropriate data warehousing levels based on the parsing results. The system can perform the following operations based on the rule:
      • The system parses the table names that you specify by using the Table Name Matching Rule parameter and obtains the number of underscores (_) that are contained in each table name. A table name can contain a maximum of nine underscores (_). You can select Business Process, Data Domain, Business Category, or Custom from the drop-down list between every two underscores.
      • If the system identifies that a table name contains the name of a data warehousing level, the system creates a table with the same name and stores the table at the data warehousing level.
      Note If a table name does not contain the name of a data warehousing level, such as the name of a data domain or business process, the data warehousing level of the table displayed in the Confirm Model Information step is empty. You can select a data warehousing level for the table in the Confirm Model Information step.
      For example, the data domains sales and supply are created and a reverse modeling policy is configured in DataWorks Data Modeling. The following descriptions provide some of the configurations of the reverse modeling policy:
      • The value of the Table Name Matching Rule parameter is dwd_sales;dim_supply.
      • The value of the Table Naming Rule parameter is dwd_Data Domain.
      The system performs the following operations:
      1. The system matches the dwd_sales and dim_supply tables in the workspace that you select from the Workspace drop-down list.
        • Matched: The system creates the dwd_sales and dim_supply tables and stores the dwd_sales table in the sales data domain and the dim_supply table in the supply data domain. You can view the created tables on the Dimensional Modeling page.
        • Not matched: The system does not create the dwd_sales and dim_supply tables. Reverse modeling fails.
      Execution Method
      • Full Update: If the tables that you specify by using the Table Name Matching Rule parameter exist in the workspace you select from the Workspace drop-down list, the system creates all matched tables.
        Note If a table already exists on the Dimensional Modeling page, the existing table is deleted and re-created after you select Full Update for the Execution Method parameter.
      • Incremental Update: If the tables that you specify by using the Table Name Matching Rule parameter exist in the workspace you select from the Workspace drop-down list, the system performs the following operations:
        1. Identifies and filters out the tables that already exist on the Dimensional Modeling page.
        2. Creates tables that do not exist on the Dimensional Modeling page.

        If some tables have been created and the tables remain unchanged, you can select this mode.

      Note If the tables that you specify by using the Table Name Matching Rule parameter do not exist in the workspace you select from the Workspace drop-down list, reverse modeling fails regardless of the execution mode that you specify.
    2. Click Create Model. The system then uses the reverse modeling policy to parse tables.
  5. Confirm the information about tables.
    1. Confirm the information about tables.
      The system generates tables based on the reverse modeling policy. You can modify the following information about the tables: Table Type, Data Layer, Business Process, Data Domain, and Business Category. If you no longer need to perform reverse modeling on a table, you can remove the table from the Parsed Tables section in the Confirm Model Information step. Confirm the information about tables
    2. Click Generate Model to finalize the tables.
  6. View reverse modeling results.
    After reverse modeling is complete, you can view the numbers of the created fact tables, dimension tables, and aggregate tables and view the details about the tables that fail to be created in the Completed step. You can click Error Logs in the Actions column of a table that fails to be created to view error information and troubleshoot issues at the earliest opportunity.
    Note
    • The created tables are automatically published to the related MaxCompute compute engine instance. You do not need to manually publish the tables again.
    • You can manage the created tables on the Dimensional Modeling page. For more information, see Publish and manage a table.
    Generate Model

View reverse modeling tasks

You can view the details and operation logs of reverse modeling tasks on the Modeling Tasks page. View reverse modeling tasks
Section Description
1 In this section, you can configure the following parameters to obtain the desired reverse modeling tasks: Task ID, Operator, and Operation Date.
2 In this section, you can view the settings of the Table Name Matching Rule parameter and the reverse modeling results.
  • For a reverse modeling task that is executed, you can click View Logs on the right side of the task on the Modeling Tasks page to view the operation logs of the task.
  • For a reverse modeling task that is not executed, you can click View Task on the right side of the task on the Modeling Tasks page to go to the task execution page and continue to execute the task.

What to do next

Tables that are created are automatically published to the related MaxCompute compute engine instance. You can go to the DataStudio page to perform subsequent data development operations. For more information, see Features on the DataStudio page.