This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new 7cec7532e84 [docs](ivm) Document incremental refresh for expressions
over aggregates (#4204)
7cec7532e84 is described below
commit 7cec7532e84008927f16b9aa04c4300bed449667
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Sat Oct 10 12:16:28 2026 +0800
[docs](ivm) Document incremental refresh for expressions over aggregates
(#4204)
After apache/doris#68787 fixed apache/doris#68742, deterministic
expressions over aggregate results, such as `SUM(amount) * 100`, support
incremental refresh. Update the English and Chinese dev IVM docs to
reflect this behavior, remove the obsolete refresh-failure paragraph and
workarounds, and correct the GROUP BY capability table and explanation.
The expressions remain subject to the restrictions of their aggregate
functions, including MIN/MAX boundary deletions.
## Versions
- [x] dev
- [ ] 4.x
- [ ] 3.x
- [ ] 2.1 or older (not covered by version/language sync gate)
IVM is introduced in Doris 5.0.0. The dev pages already state this
version requirement; there is no corresponding IVM reference page for
4.x or earlier. This explains the version-sync check's missing-4.x
warning.
## Languages
- [x] Chinese
- [x] English
## Docs Checklist
- [x] Checked by AI
- [ ] Test Cases Built
- [x] Updated required version and language counterparts, or explained
why not
- [x] If only one language changed, confirmed whether source/translation
counterparts need sync (both languages updated)
## Validation
- Cross-checked the merged fix and its regression cases for expressions
over aggregates.
- Both pages compile with the Docusaurus MDX pipeline.
- Changed-page link and Markdown structure checks pass.
- English and Chinese code blocks match (67 blocks); SQL examples are
unchanged.
- `git diff --check` passes.
No Doris test suite was run for this prose change. The SEO check reports
existing description-length warnings; front matter is unchanged.
Co-authored-by: morningman <[email protected]>
---
.../async-materialized-view/incremental-materialized-view.mdx | 6 ++----
.../async-materialized-view/incremental-materialized-view.mdx | 6 ++----
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git
a/docs/query-acceleration/materialized-view/async-materialized-view/incremental-materialized-view.mdx
b/docs/query-acceleration/materialized-view/async-materialized-view/incremental-materialized-view.mdx
index 290baeda822..f86c4997890 100644
---
a/docs/query-acceleration/materialized-view/async-materialized-view/incremental-materialized-view.mdx
+++
b/docs/query-acceleration/materialized-view/async-materialized-view/incremental-materialized-view.mdx
@@ -355,7 +355,7 @@ Every example follows the same steps: run its `CREATE
MATERIALIZED VIEW`, then r
| `WHERE` filters | Filter the rows of the base tables by a condition |
| `FROM` subqueries | Aliased subqueries in the `FROM` clause; they can be
nested and must not contain aggregations |
| Constant rows | A `SELECT` without `FROM` that always returns one row of
constants, for example `SELECT -1, 'unknown'`. It can be a `UNION ALL` branch,
one side of a join, or the whole definition |
-| `GROUP BY` aggregation | The aggregation must be the outermost operation of
the query with only projections above it, and an aggregate result must not be
wrapped in another expression |
+| `GROUP BY` aggregation | The aggregation must be the outermost operation of
the query with only projections above it; deterministic expressions on group-by
columns and aggregate results are supported |
| `GROUPING SETS`, `ROLLUP`, `CUBE` | Can be used with `GROUPING()` and
`GROUPING_ID()`; the same restrictions as `GROUP BY` apply |
| `SELECT DISTINCT` | Handled as a `GROUP BY` without aggregate functions; the
same restrictions as `GROUP BY` apply |
| `INNER JOIN`, `CROSS JOIN` | Multi-table joins and self-joins are supported |
@@ -521,7 +521,7 @@ Result:
+----------+----------+--------------+
```
-The projection above the aggregation can rename columns, reorder them, or
compute on the group-by columns. `HAVING`, aggregations inside a subquery or a
join input, and expressions wrapped around an aggregate result are not
supported. See [Unsupported query forms](#unsupported-query-forms).
+The projection above the aggregation can rename columns, reorder them, or use
deterministic expressions to compute on group-by columns and aggregate results.
For example, `SUM(amount) * 100`, `MAX(amount) + 1` and `SUM(amount) /
COUNT(*)` support incremental refresh, subject to the restrictions of the
aggregate functions used. `HAVING` and aggregations inside a subquery or a join
input are not supported. See [Unsupported query
forms](#unsupported-query-forms).
</TabItem>
<TabItem value="grouping-sets" label="GROUPING SETS / ROLLUP / CUBE">
@@ -1075,8 +1075,6 @@ The following forms are not supported, and creation fails
with an explicit `REFR
- Using a regular asynchronous materialized view as a base table. Chained
maintenance requires the lower-level materialized view to be an IVM as well.
- Any other operation not listed in the table above.
-In addition, an expression wrapped around an aggregate result can be created,
but every incremental refresh of it fails, for example `SUM(amount) * 100`,
`MAX(amount) + 1` and `SUM(amount) / COUNT(*)`. A strict `INCREMENTAL` refresh
fails with `IvmFallbackReason` `PLAN_REWRITE_FAILED`, and `INCREMENTAL
FALLBACK` falls back to `COMPLETE` every time. Output the aggregate result
directly and compute on it when querying the materialized view, or move the
expression into the argument of the a [...]
-
<!-- Knowledge type: Runtime behavior / Failure handling -->
<!-- Use cases: Configuring the refresh strategy / Automatic refresh interval
/ Diagnosing IVM fallback / Rebuilding the baseline -->
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/incremental-materialized-view.mdx
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/incremental-materialized-view.mdx
index d1bbf7d784b..639db62e10c 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/incremental-materialized-view.mdx
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/incremental-materialized-view.mdx
@@ -355,7 +355,7 @@ INSERT INTO refunds VALUES
| `WHERE` 过滤 | 按条件过滤基表的行 |
| `FROM` 子查询 | `FROM` 子句中带别名的子查询,可以多层嵌套,内部不能包含聚合 |
| 常量行 | 不带 `FROM` 的 `SELECT`,结果固定为一行常量,例如 `SELECT -1, 'unknown'`。可以作为 `UNION
ALL` 的分支或 Join 的一侧,也可以单独作为定义 |
-| `GROUP BY` 聚合 | 聚合必须位于查询最外层,之上只能有投影,且不能在聚合结果外再套表达式 |
+| `GROUP BY` 聚合 | 聚合必须位于查询最外层,之上只能有投影;支持对分组列和聚合结果使用确定性表达式 |
| `GROUPING SETS`、`ROLLUP`、`CUBE` | 可以配合 `GROUPING()`、`GROUPING_ID()` 使用,限制与
`GROUP BY` 相同 |
| `SELECT DISTINCT` | 按不带聚合函数的 `GROUP BY` 处理,限制与 `GROUP BY` 相同 |
| `INNER JOIN`、`CROSS JOIN` | 支持多表连接和自连接 |
@@ -521,7 +521,7 @@ GROUP BY c.city;
+----------+----------+--------------+
```
-聚合之上的投影可以给列改名、调整列顺序,或者对分组列做计算。`HAVING`、写在子查询或 Join
输入中的聚合,以及在聚合结果外再套表达式的写法都不支持,见 [不支持的查询形式](#不支持的查询形式)。
+聚合之上的投影可以给列改名、调整列顺序,或者用确定性表达式对分组列和聚合结果做计算。例如,`SUM(amount) * 100`、`MAX(amount)
+ 1` 和 `SUM(amount) / COUNT(*)` 均支持增量刷新,但仍需遵守所用聚合函数的限制。`HAVING` 和写在子查询或 Join
输入中的聚合不支持,见 [不支持的查询形式](#不支持的查询形式)。
</TabItem>
<TabItem value="grouping-sets" label="GROUPING SETS / ROLLUP / CUBE">
@@ -1075,8 +1075,6 @@ GROUP BY channel;
- 使用普通异步物化视图作为基表。链式维护要求下层物化视图本身也是 IVM。
- 上文表格之外的其他运算。
-另外,在聚合结果外再套表达式的写法虽然可以创建,但每次增量刷新都会失败,例如 `SUM(amount) * 100`、`MAX(amount) + 1` 和
`SUM(amount) / COUNT(*)`。严格 `INCREMENTAL` 刷新失败时,`IvmFallbackReason` 为
`PLAN_REWRITE_FAILED`;`INCREMENTAL FALLBACK` 每次都会回退到
`COMPLETE`。可以直接输出聚合结果,在查询物化视图时再计算;或者把表达式写进聚合函数的参数,例如 `SUM(amount * 100)`。
-
<!-- 知识类型: 运行机制 / 故障处理 -->
<!-- 适用场景: 刷新策略配置 / 自动刷新间隔 / IVM 回退排查 / 基线恢复 -->
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]