All Products
Search
Document Center

DataWorks:Publish a model

Last Updated:Mar 26, 2026

After completing a Logical Model design in DataWorks, publish it to a compute engine to materialize it as a physical table, view, or materialized view. Once materialized, the table is available for data development and analysis.

Limitations

Before publishing, confirm that your environment meets the following requirements:

  • Target engines: MaxCompute, Hologres, E-MapReduce (EMR) Hive, CDH, and MySQL.

  • Publish type constraints:

    • View and Materialized View are supported for MaxCompute only.

    • Materialized View requires the Delete and Recreate publish mode.

  • Environment:

    • Basic mode workspaces can only publish to the Production environment.

    • Standard mode workspaces can publish to either the Development or Production environment.

  • Resource group: Publishing physical tables to EMR Hive or CDH requires an Exclusive Resource Group for Scheduling or a Serverless Resource Group with network connectivity to the data source.

Publish a model

Publish a dimension table, fact table, aggregate table, or application table to a data source instance. The published table is materialized in the target compute engine and becomes available for data development and analysis.

  1. After you create a model, click the 发布 icon in the toolbar on the table details page.

  2. In the Publish dialog box, configure the following parameters.

    Parameter Description
    Publish Type The materialization format for the model. See Choose a publish type below.
    Data Source Type The engine where data is stored. Options: MaxCompute, E-MapReduce (EMR) Hive, Hologres, CDH, and MySQL.
    Effective Environment The environment where the model is published — Development or Production. Basic mode workspaces can only target Production.
    Publish Mode Incremental Publish: Applies only the model's schema changes to the target engine. Use for previously published models to preserve historical data and minimize impact on running services. Delete and Recreate: Drops the existing table and recreates it from scratch. This results in historical data loss. When publishing for the first time, both modes have the same effect.
    Automatic Rule Generation Based on Field Standard Whether to auto-generate data quality rules after publishing. If set to Yes, the system generates rules for primary key fields, NOT NULL fields, and fields associated with standard codes after a successful publish to Production. For more information, see Data Tagging.
    Resource Group Required when publishing physical tables to EMR Hive or CDH. Select a resource group that has network connectivity to the data source. To publish to EMR Hive or CDH, use an Exclusive Resource Group for Scheduling or a Serverless Resource Group. If you don't have an Exclusive Resource Group for Scheduling, see Use an Exclusive Resource Group for Scheduling.
    DDL Required only when publishing as a Materialized View. Edit the AS SELECT clause to provide a valid, executable SQL statement. For DDL syntax, see Materialized View operations.

    发布设置

  3. Click Publish. The system publishes the model to the selected environment and materializes it in the target engine. Monitor progress and logs in the Publish dialog box. To publish the model to a different environment, click Publish again and select the other environment.

  4. (Optional) Click the 日志 icon in the toolbar to view the most recent publish operation. Publishing status has three states: Succeeded, Failed, and Publishing. The following figure shows a log for a successful publish.

    If publishing status shows Failed, identify and resolve the issue based on the error message. If the Publishing Logs dialog box shows No publishing logs found., the model has never been published.

    发布日志

  5. After a successful publish, go to the model's edit page and click Publishing Record in the right-side navigation pane to view historical published versions.

    image

Choose a publish type

Start with Physical Table for most use cases. Switch to View when you need real-time data without storage overhead. Use Materialized View only when your queries involve expensive, repeated JOINs or aggregations on data that changes infrequently — and when the query savings justify the additional compute cost of maintaining the view.

Publish type What it creates Engine support When to use
Physical Table A physical table in the target engine All supported engines Default for most cases. Best for tables accessed frequently by end users or downstream pipelines.
View A view in the target engine MaxCompute only Use when you need the view to always reflect the latest state of its source data. No storage overhead.
Materialized View A precomputed result set stored as a table MaxCompute only Use when queries involve expensive JOINs or aggregations that run repeatedly on data that doesn't change often. Reusing precomputed results accelerates query performance. Maintaining a Materialized View consumes additional compute resources — choose this option only when query savings outweigh the maintenance cost. Requires Delete and Recreate publish mode.

Generate an ETL code framework

The Model Development feature in DataWorks Intelligent Data Modeling generates an ETL code framework for published model tables, such as dimension tables and fact tables. This is supported for models published to MaxCompute and EMR Hive only.

  1. In DataWorks Intelligent Data Modeling, double-click a published model table to open its details page.

  2. In the actions bar, click Develop Model.

  3. In the Develop Model dialog box, select an option and configure the parameters.

    • Create DataStudio Node PixPin_2025-12-22_16-16-44 The system creates a DataStudio node and populates the node name from the table name: Click Go to DataStudio. In the node creation dialog box that opens, click OK to create the node and generate the ETL code.

      • MaxCompute tables: ODPS SQL node

      • EMR Hive tables: EMR Hive node

    • Associate DataStudio Node PixPin_2025-12-22_16-17-17 Associates the ETL code framework with an existing DataStudio node of the same engine type. After binding, click the node name to open the node page and continue development.

    To associate multiple nodes with the same model table, click Develop Model again to bind another node.
  4. Click OK.

Billing

Publishing a model is free. After materialization, you are billed for compute and storage resources consumed in the target engine — for example, MaxCompute or Hologres — based on the respective product's pricing.