Designing Physical Models
A physical model is a physical description about the conversion of elements such as entities, attributes, attribute constraints, and relationships from a logical model to a table relationship diagram that can be identified by database software using certain rules and methods.
To create an ER model tailored to your business scenario, you need to create a physical model first, and then create tables in the model.
The following parts are included in this section:
Considerations in Physical Model Design
- Physical models must ensure that the required functions are available and their performance is as good as expected.
- Physical models must ensure data consistency and quality.
- Few or no changes are made to the physical models when new services or functions are added.
Creating a Physical Model
- 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 ER Modeling from the left navigation bar.
- On the ER Modeling page, if no ER model has been created, the system displays a dialog box asking you to create one. If you have created ER models before, click
to create new models. See the figure below. Figure 1 ER Modeling page
- In the displayed dialog box, set parameters as prompted and click OK. Figure 2 Creating a model
Table 1 Parameters Parameter
Description
Model Name
Only letters, digits, and underscores (_) are allowed.
Model Type
Select Physical model. For details on the physical model, see the physical model description.
Data Connection Type
Currently, DLI, DWS, and MRS_HIVE are supported.
Description
A description of the ER model. Up to 600 characters are supported.
Creating and Publishing a Table
After creating a DLI, DWS, or an MRS_HIVE ER model, you can create a business table in the model.
- On the DGC Data Design console, choose ER Modeling from the left navigation bar.
- On the displayed page, select a model, expand it, and select a subdirectory. Then, click Create.
- On the Create Table page, set parameters as required.
- Set the basic parameters described in the figure below. Figure 3 Basic Settings tab page
Table 2 Parameters Parameter
Description
Subject
Click Select to select a subject.
Table Name
The name of the table to be created. Only letters, digits, and underscores (_) are allowed. Table names cannot start with digits.
Table Code
The code of the table to be created. Only letters, digits, underscores (_), $, {, and } are allowed. Table codes cannot start with digits.
Data Connection Type
N/A
Data Connection
The name of the data connection. Select the required data connection. You are advised to use the same data connection for an ER model.
If you have not created a data connection yet, go to the DGC Management Center to create one. For details, 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 for tables created in DLI models.
Schema
DWS mode. This parameter is valid only for DWS tables.
Table Type
DLI models support the following table types:
- Managed indicates that data is stored in a DLI table.
- External indicates that data is stored in an OBS table. When Table Type is set to External, you need to set OBS Path. The OBS path format is /bucket_name/filepath.
DWS models support the following table types:
- DWS_ROW indicates that tables are stored to disk partitions by row.
- DWS_COLUMN indicates that tables are stored to disk partitions by column.
This parameter is unavailable for the tables created in MRS_HIVE models.
Data Format
This parameter is available only for tables created in DLI models. The supported data formats are as follows:
- Parquet: DLI can read non-compressed data or parquet data that is compressed using snappy and gzip.
- CSV: DLI can read non-compressed data or csv data that is compressed using gzip.
- ORC: DLI can read non-compressed data or orc data that is compressed using Snappy.
- JSON: DLI can read non-compressed data or json data that is compressed using gzip.
- Carbon: DLI can read non-compressed carbon data.
- Avro: DLI can read uncompressed avro data.
Advanced Settings
You can set custom items.
Tag
Tags are custom identifiers that help users classify and search for data assets. After adding a tag, you can search for related data assets in the DGC Data Assets module with ease.
Click
to add a tag to the table. In the dialog box that is displayed, select one or more existing tags, or enter a new tag name and press Enter. You can also go to the Tag Management page of the DGC Data Assets module to add a tag. Then, return to this page and select the newly added tag from the tag drop-down list. See Tags.Owner
Select an asset owner from the drop-down list. Only the workspace administrator or developer can be set as the owner.
Description
A description of the table. Up to 200 characters are supported.
- Add required fields on the Table Fields page. Figure 4 Table Fields tab page
Table 3 Parameters of table fields Parameter
Description
Name
Table names must start with letters. Only letters, digits, and underscores (_) are allowed.
Code
Table codes must start with letters. Only letters, digits, and underscores (_) are allowed.
Data Type
Field data type. If the required data type does not exist, you can add one. See Managing a Field Type.
Data Standard
If you have created data standards, click
to select one to associate with the field. Choose Configuration Center > Function Configuration and select Create Quality Jobs. Associate fields with a data standard. After a table is published, a quality job is automatically generated. A quality rule is generated for each field associated with the data standard. The quality of the field is monitored based on the data standard. You can go to the Quality Job page of the DGC Data Quality Control to view the job details.If you click Associate with Data Standard above the field list and select a data standard that you want to associate the field with, a new table field associated with the selected data standard is automatically created. The default field name and code are the same as those of the associated data standard. You can change the field name and code if necessary.
If you have not created a data standard, create one. See Data Standards for details.
Primary Key
If this parameter is selected, the field is a primary key.
Partition
If this parameter is selected, the field is a partition field.
Not Null
Whether the parameter value can be left empty.
Tag
Click
to add a tag.- In the displayed dialog box, select one or more existing tags. If no tag has been added, you can go to the Tag Management page of the DGC Data Assets to add a tag. See Tags.
- In the dialog box that is displayed, enter a new tag name and press Enter. Tag names can contain letters, digits, and underscores (_), but cannot start with underscores (_).
Description
A description of the field to be added.
- (Optional) On the Relationships tab page, click Create to create a relationship.
A relationship refers to the logical relationship between two entities. It describes how an entity is associated with another entity, or the impact of an entity's behavior on another entity. Relationships between entities in a data model are particularly important and must be accurately defined. Otherwise, the actual business rules cannot be accurately described in the data model, and data consistency is greatly damaged.
Figure 5 Relationships tab page
Table 4 Parameters Parameter
Description
Name
Each relationship has a name to describe the function of the relationship.
Child Table
Click this field to select a table from the drop-down list. Click
to set the current table as a child table.Child Table Field
Select fields in the child table.
Child to Table
indicates that each piece of data in the child table corresponds to only one piece of data in the parent table.
indicates that each piece of data in the child table corresponds to one piece of data at most in the parent table.
indicates that one piece of data in the child table corresponds to multiple pieces of data in the parent table.
indicates that each piece of data in the child table corresponds to at least one piece of data in the parent table.Parent to Child
indicates that each piece of data in the parent table corresponds to only one piece of data in the child table.
indicates that each piece of data in the parent table corresponds to one piece of data at most in the child table.
indicates that one piece of data in the parent table corresponds to multiple pieces of data in the child table.
indicates that one piece of data in the parent table corresponds to one piece of data in the child table at least.Parent Table
Select a table that has a logical relationship with the selected child table.
Table Field
Select fields in the parent table.
Role Name
You can customize a role name to identify the relationship.
Operation
Click
to delete a relationship. Click
to edit the relationship. - (Optional) On the Mappings tab page, click Create to create a mapping and design a data source based on the created mapping.
- If the table field comes from different relationship models, you need to create multiple mappings.
Currently, table data can be obtained from ER models of different connection types. In each mapping, you only need to set the source field for the field that comes from the current mapping. Other fields do not need to be set.
For example, if the data of the first five fields and the last five fields in the current table comes from two different models, you need to create the following mappings:
- map1: Create a table named table01 from ER model A. In the Field Mapping area, set the source fields of the first to fifth fields to the corresponding fields with the same meaning in table01. The last five fields do not need to be set.
- map1: Create a table named table02 from ER model A. In the Field Mapping area, set the source fields of the sixth to tenth fields to the corresponding fields with the same meaning in table02. The first five fields do not need to be set.
- If the field data in a table comes from multiple tables in the same ER model, you can create a mapping.
In the source table of the mapping, you can set Join conditions for multiple tables, and then set source fields for the fields in the table. The selected source fields must have the same meanings as the fields in the table.
For example, assume that all fields in the current table come from ER model d1, the first field comes from the vendor table, the second field comes from the payment_type table, the third field comes from the rate table, and other fields come from the dwd_taxi_trip_data table.
You can create a mapping, as shown in Figure 6. Join the dwd_taxi_trip_data table with the vendor, payment_type, and rate tables, and set the source fields in sequence in the field mapping.
For details on the parameters for creating a mapping, see Table 5.
Table 5 Parameters of mappings Parameter
Description
Mapping
Only letters, digits, and underscores (_) are allowed.
Model
Select a created relationship model from the drop-down list box. If no relationship model has been created, create one. See Designing Physical Models.
Table
Select a table from which data is obtained. If data is obtained from multiple tables, click
next to the table name to set the JOIN condition between the table and another table.- Select a JOIN mode. The JOIN mode includes left JOIN, right JOIN, inner JOIN, and outer JOIN from left to right.
- Set the JOIN condition in the JOIN field. Generally, select the fields with the same meaning in the source table and joined table. Click
or
to add or delete a JOIN condition. The relationship between JOIN conditions is AND. - Click OK.
- If you want to delete a joined table after setting the JOIN condition, click
next to the table name.
Figure 7 Join Condition dialog box
Field Mapping
Select a source field with the same meaning as the current mapping field. If a table field comes from multiple models, you need to create multiple mappings. In each mapping, you only need to set the source field for the field that comes from the current mapping. Other fields do not need to be set.
In the upper right corner of the Mappings area, click
to delete a specified mapping or click
to collapse the mapping area. - If the table field comes from different relationship models, you need to create multiple mappings.
- (Optional) If the type of the new table is DWS_VIEW, click Create to create a view. Figure 8 Creating a view
Table 6 Parameters Parameter
Description
Mapping
Only letters, digits, and underscores (_) are allowed.
Model
Select a created relationship model from the drop-down list box. If no relationship model has been created, create one. See Designing Physical Models.
Table
Select a table from which data is obtained. If data is obtained from multiple tables, click
next to the table name to set the JOIN condition between the table and another table.- Select a JOIN mode. The JOIN mode includes left JOIN, right JOIN, inner JOIN, and outer JOIN from left to right.
- Set the JOIN condition in the JOIN field. Generally, select the fields with the same meaning in the source table and joined table. Click
or
to add or delete a JOIN condition. The relationship between JOIN conditions is AND. - Click OK.
- If you want to delete a joined table after setting the JOIN condition, click
next to the table name.
Figure 9 Join Condition dialog box
Field Mapping
Select a source field with the same meaning as the current mapping field. If a table field comes from multiple models, you need to create multiple mappings. In each mapping, you only need to set the source field for the field that comes from the current mapping. Other fields do not need to be set.
In the upper right corner of the Mappings area, click
to delete a specified mapping or click
to collapse the mapping area.
- Set the basic parameters described in the figure below.
- Click Publish, select a reviewer, and click Submit.
- Wait for the reviewer to approve the application. After the application is approved, return to the ER Modeling page to view the table status and synchronization status. Publishing is an asynchronous operation. You can click
to refresh the status. After table publishing application is approved, operations such as creating tables and synchronizing technical assets and business assets based on the configurations of Model Design Process on the Function Configuration page. The synchronization status is displayed in the Sync Status column of the table on the Information Architecture page. - If the synchronization is successful, the table is successfully published. Move the cursor to
in the Sync Status column. If the message indicating "creation succeeded" is displayed, the table has been successfully created in the corresponding data source. - If one or more items fail to be synchronized, you can refresh the status. If the fault persists, choose More > Publish History to view logs.
Troubleshoot the problem based on the logs. After the error is rectified, click Resynchronize in the Publish Log tab to issue the synchronization command again. If the synchronization still fails, contact technical support for assistance.
- If the synchronization is successful, the table is successfully published. Move the cursor to
Last Article: Designing Logical Models
Next Article: Reversing Databases

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.