All Products
Search
Document Center

MaxCompute:Delta Live Materialized View (Delta Live MV) (Invitational Preview)

Last Updated:Mar 26, 2026

Delta Live Materialized View (Delta Live MV) lets you build incremental update pipelines in MaxCompute using declarative SQL. Instead of recomputing the full result on every run, it processes only changed data from source tables — reducing compute cost while keeping results fresh at minute-level latency.

This feature is currently in invitational preview. For access, see Instructions.

How it works

image

Delta Live MV reads Change Data Capture (CDC) events from source tables, computes the incremental diff using the view's SQL definition, and merges the result into the materialized view. When no source data has changed, the refresh job skips execution — no compute is consumed.

Key characteristics:

  • Declarative SQL — define the logic once; the engine handles both incremental and full computation automatically.

  • Fully managed — auto-refresh, scheduling, and data warehouse layering are handled by MaxCompute.

  • Cost-aware — auto-refresh skips the SQL job when no incremental data is detected, so idle time costs nothing.

Use cases

  • Near-real-time data warehouse — evolve from T+1 batch pipelines to minute-level latency without rewriting your SQL logic.

  • Unified incremental and full processing — run near-real-time incremental computation for today's partitions while optionally backfilling historical partitions for archival or data correction.

Prerequisites

Before you begin, ensure that you have:

  • A MaxCompute project. See Create a MaxCompute project.

  • Change Data Capture (CDC) enabled on the source table. Supported source types:

    • A Delta Table with the CDC feature explicitly enabled.

    • Another Delta Live MV (CDC is enabled by default on Delta Live MVs).

Supported SQL operators

Delta Live MV evaluates whether each SQL operator supports incremental computation at view creation time. Operators that do not support incremental computation trigger a full refresh instead.

Operator Incremental refresh Notes
INNER JOIN (two streams) Supported
LEFT/RIGHT OUTER JOIN (two streams) Supported
Aggregate functions (without GROUP BY) Supported User-defined aggregate functions (UDAFs) are not supported
Aggregate functions (with GROUP BY) Supported UDAFs are not supported
WINDOW functions Supported
TableFunctionScan Supported
UNION ALL Supported
FILTER / Project Supported
SUBQUERY Supported
Delta Live MVs cannot contain non-deterministic computations (for example, the RAND function) or user-defined functions (UDFs).

Limitations

  • Delta Live MVs cannot be created as clustered tables.

  • The enable_auto_substitute parameter cannot be set to true. Because Delta Live MV is asynchronous, its data may not reflect the latest version of the base table, which conflicts with query substitution.

Create a Delta Live MV

Syntax

CREATE MATERIALIZED VIEW [IF NOT EXISTS] [<project_name>.]<mv_name>
[LIFECYCLE <days>]
[BUILD DEFERRED]
[(<col_name> [COMMENT <col_comment>], ...)]
[DISABLE REWRITE]
[COMMENT <table_comment>]
[PARTITIONED ON/BY (<col_name> [, <col_name>, ...])]
[REFRESH EVERY <num> MINUTES|HOURS|DAYS]
TBLPROPERTIES (
  "refresh_mode" = "incremental"
  [, "enable_auto_refresh" = "true"]
  [, "refresh_cron" = "<cron_expression>"]
  [, "refresh_job_settings" = "<session_flags>"]
)
AS <select_statement>;

Parameters

Parameter Required Description
project_name No The project name.
mv_name Yes The name of the Delta Live MV.
LIFECYCLE <days> No Data retention period in days.
BUILD DEFERRED No Creates the table schema without generating data. When creating a partitioned Delta Live MV, include BUILD DEFERRED to run only DDL without generating data.
col_name No Column name.
col_comment No Column-level comment.
DISABLE REWRITE No Excludes this view from query rewriting.
table_comment No Table-level comment.
REFRESH EVERY <num> MINUTES|HOURS|DAYS No Scheduled refresh interval. Minimum: 1 minute. Set this to a value shorter than the CDC lifecycle of the base table to avoid missing incremental data.
enable_auto_refresh No true to enable auto-refresh; false to disable.
refresh_mode No incremental for incremental refresh; full for full refresh.
refresh_cron No A QUARTZ Cron expression for point-in-time or interval-based scheduling. See Cron expression examples.
refresh_job_settings No Session flags applied during each refresh run. These take precedence over the current session flags. Example: set odps.sql.split.size=128;set odps.sql.reshuffle.dynamicpt=false;
select_statement Yes The SQL query that defines the view.

Examples

Create a simple Delta Live MV

The following example creates mv1, which refreshes incrementally every 5 minutes. The source table is a Delta Table with CDC enabled.

CREATE MATERIALIZED VIEW IF NOT EXISTS mv1
REFRESH EVERY 5 MINUTES
TBLPROPERTIES (
  "enable_auto_refresh" = "true",
  "refresh_mode" = "incremental"
)
AS
SELECT name, COUNT(*) FROM source GROUP BY name;

Create a Delta Live MV with tuning parameters

The following example creates a partitioned Delta Live MV with custom session flags applied at refresh time.

CREATE MATERIALIZED VIEW IF NOT EXISTS part_dlmv_department
PRIMARY KEY (dept_id)
LIFECYCLE 10
BUILD DEFERRED
PARTITIONED BY (pt)
TBLPROPERTIES (
  "refresh_mode" = "incremental",
  "refresh_job_settings" = "set odps.sql.split.size=128;set odps.sql.reshuffle.dynamicpt=false;"
)
AS SELECT *, get_setting('odps.custom.setting.department.pt') AS pt FROM t_department;

Create a partitioned Delta Live MV with per-partition refresh

Use BUILD DEFERRED to create the schema without generating data, then refresh individual partitions on demand.

-- Create the Delta Live MV (schema only)
CREATE MATERIALIZED VIEW dlmv_pt
PRIMARY KEY (value)
BUILD DEFERRED
PARTITIONED BY (ds)
TBLPROPERTIES (
  "refresh_mode" = "incremental",
  "enable_auto_refresh" = "true"
)
AS SELECT value, AVG(value2), ds FROM dlmv_pt_src GROUP BY value, ds;

-- Refresh a single partition
ALTER MATERIALIZED VIEW dlmv_pt REBUILD PARTITION (ds='20250730');

For more on manual refresh, see Refresh a Delta Live MV manually.

Create a parameterized Delta Live MV

Use the get_setting function to inject partition parameters at refresh time. This lets you migrate offline partition jobs to incremental jobs without changing the SQL logic.

All parameter names must start with the odps.custom.setting prefix. At refresh time, set the parameter value using a session flag before running the REBUILD command.

-- Create the Delta Live MV
CREATE MATERIALIZED VIEW mv1
BUILD DEFERRED
PARTITIONED BY (ds)
REFRESH EVERY 5 MINUTES
TBLPROPERTIES (
  "enable_auto_refresh" = "true",
  "refresh_mode" = "incremental"
)
AS
SELECT A.* FROM A JOIN B ON A.c1 = B.c1
  AND A.ds = get_setting('odps.custom.setting.bizdate.a')
  AND B.ds = get_setting('odps.custom.setting.bizdate.b');

-- Refresh logic (DataWorks scheduling replaces ${biz_date} and ${yesterday} automatically)
SET odps.custom.setting.bizdate.a = ${biz_date};
SET odps.custom.setting.bizdate.b = ${yesterday};
ALTER MATERIALIZED VIEW mv1 REBUILD PARTITION (ds=${biz_date});

Manage a Delta Live MV

Drop a Delta Live MV

DROP MATERIALIZED VIEW [IF EXISTS] [<project_name>.]<mv_name>;

Refresh a Delta Live MV manually

Delta Live MV supports manual refresh for individual partitions. The syntax matches standard materialized views:

ALTER MATERIALIZED VIEW [<project_name>.]<mv_name>
  REBUILD [PARTITION (<ds> = max_pt(<table_name>), <expression1>, ...)];

Here, ds is the partition key column.

Disable auto-refresh

ALTER MATERIALIZED VIEW <mv_name> SET TBLPROPERTIES ("enable_auto_refresh" = "false");

Enable or resume auto-refresh

ALTER MATERIALIZED VIEW <mv_name> SET TBLPROPERTIES ("enable_auto_refresh" = "true");

Change the refresh frequency

ALTER MATERIALIZED VIEW <mv_name>
SET TBLPROPERTIES ("refresh_interval_minutes" = "<value>");

The minimum value is 1. Set this to a value shorter than the CDC lifecycle of the base table to avoid missing incremental data.

View refresh history and data changes

View data change history

SHOW HISTORY FOR TABLE <mv_name>;

Sample output:

ObjectType  ObjectId                          ObjectName      VERSION(LSN)        Time                  Operation
TABLE       d95ec7015e8b432e8e0092d01da962a9  incremental_mv  0000000000000001    2024-08-18 21:06:32   CREATE
TABLE       d95ec7015e8b432e8e0092d01da962a9  incremental_mv  0000000000000002    2024-08-18 21:11:13   UPDATE

View refresh history

SELECT * FROM Delta_Live_MV_Refresh_History(
  ['<project_name>', '<schema_name>',] '<table_name>'
);

Parameter Description

Parameter Description
project_name The project that owns the Delta Live MV. Optional.
schema_name The schema that owns the Delta Live MV. Optional.
table_name The Delta Live MV name. Required.

Return Value Description

Field Description
project_name The project that owns the Delta Live MV.
schema_name The schema that owns the Delta Live MV.
name The Delta Live MV name.
refresh_start_time When the refresh job started.
refresh_end_time When the refresh job ended. NULL if the job is still running.
instance_id The job ID. Use this to open the job in Logview.
duration_in_seconds How long the refresh took, in seconds.
state Job state: RUNNING, TERMINATED, FAILED, or CANCELLED.
refresh_trigger What triggered the refresh: MANUAL (user-initiated or DataWorks scheduling) or SYSTEM_SCHEDULED (MaxCompute internal).
refresh_mode The refresh mode used: FULL, INCREMENTAL, or NO_DATA (no changes detected).
error_message The error message if the refresh failed. NULL on success.
source_tables The names and versions of the base tables used in this refresh.
numInsertedRows The number of rows inserted.
numDeletedRows The number of rows deleted.

Billing

Delta Live MV billing covers both compute and storage. The rules align with standard materialized view billing.

Compute fees

Compute fees apply only when a refresh job actually runs — either during creation or during a scheduled or manual refresh. The fees follow the same rules as standard SQL jobs.

Auto-refresh skips the SQL job entirely when MaxCompute detects no incremental data changes in the source tables, incurring no compute fee. To track auto-refresh jobs, compute resource usage, and associated costs, place Delta Live MVs in a dedicated project.

Storage fees

Delta Live MVs are billed for storage the same way as standard materialized views and regular tables. Two additional storage factors apply:

  • State tables — for certain SQL operators, the incremental computation algorithm maintains an internal state table. This state table consumes additional storage.

  • CDC and time travel storage — Delta Live MVs require incremental CDC logs and time travel data, similar to standard Delta Tables.