From 950fb1c08d3d53b4a50f694ad003e6cb239285dc Mon Sep 17 00:00:00 2001 From: niuxianhui Date: Fri, 22 May 2026 05:59:49 -0700 Subject: [PATCH] [fix](doc) content corrections in zh 2.1 function/reference docs - array-enumerate-uniq: the 3-array example result was [1, 1, 2, 1, 3]; the position-3 tuple (1,1,1) is its 2nd occurrence, so the correct result is [1, 1, 2, 2, 3]. - elt: example repeated ELT(2, ...) twice; replace with a 0/1/2 variety (ELT(1), ELT(2), ELT(0)) and realign the result table. - nulls: truth-table header said "Value of A" but the rows use the variable `a`; lowercase it. - json-exists-path: both parameter descriptions were copied from an array function ("element to include in the JSON array" / "path to insert"); replace with the correct JSON-string-to-inspect / path-to-test descriptions. - json-type: syntax and parameter table listed only , but the examples pass two arguments; add the missing argument. - async-materialized-view/use-guide: claimed aggregation produces ~17,000,000 rows from a 1,000,000-row table, which is impossible (aggregation cannot exceed the input row count). Reword: when the cardinality product approaches or exceeds the row count, aggregation barely reduces rows. Reported in #2531, #2523, #2518, #2533, #2534, #2477. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../async-materialized-view/use-guide.md | 2 +- .../version-2.1/sql-manual/basic-element/nulls.md | 2 +- .../array-functions/array-enumerate-uniq.md | 2 +- .../json-functions/json-exists-path.md | 4 ++-- .../scalar-functions/json-functions/json-type.md | 3 ++- .../scalar-functions/string-functions/elt.md | 12 ++++++------ 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/use-guide.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/use-guide.md index 549868fd91c49..29e33c700df59 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/use-guide.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/use-guide.md @@ -330,7 +330,7 @@ GROUP BY 比如表 t1,原表的数据量是 1000000,查询语句 SQL 中有 `group by a, b, c`。如果 a,b,c 的基数分别是 100,50,15,那么聚合后的数据大概在 75000 左右,说明此物化视图是有效的。如果 a,b,c 具有相关性,那么聚合后的数据量会进一步减少。 - 如果 a, b, c 的基数很高,会导致聚合后的数据急速膨胀。如果聚合后的数据比原表的数据还多,可能这样的场景不太适合构建物化视图。比如 c 的基数是 3500,那么聚合后的数据量在 17000000 左右,比原表数据量大的多,构建这样的物化视图性能加速收益低。 + 如果 a, b, c 的基数很高,分组组合数(基数乘积)会接近甚至超过原表行数,此时聚合几乎不能减少行数(聚合后的行数最多等于原表行数)。比如 c 的基数是 3500,a、b、c 的基数乘积约为 17500000,已远超原表的 1000000 行,聚合后几乎无法减少行数,构建这样的物化视图性能加速收益低。 物化视图的聚合粒度要比查询细,即物化视图的聚合维度包含查询的聚合维度,这样才能提供查询所需的数据。查询可以不写 Group By,同理,物化视图的聚合函数应该包含查询的聚合函数。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/basic-element/nulls.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/basic-element/nulls.md index 389d34e1df376..ac3b30784bba5 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/basic-element/nulls.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/basic-element/nulls.md @@ -28,7 +28,7 @@ 下表显示了条件中涉及 NULL 的各种评估的示例。如果在 SELECT 语句的 WHERE 子句中使用计算结果为 UNKNOWN 的条件,那么该查询将不返回任何行。 -| **Condition** | **Value of A** | **Evaluation** | +| **Condition** | **Value of a** | **Evaluation** | | :-------------- | :------------- | :------------- | | `a IS NULL` | `10` | `FALSE` | | `a IS NOT NULL` | `10` | `TRUE` | diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/array-functions/array-enumerate-uniq.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/array-functions/array-enumerate-uniq.md index 1548a3c15904d..df6791cb2009e 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/array-functions/array-enumerate-uniq.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/array-functions/array-enumerate-uniq.md @@ -42,6 +42,6 @@ select array_enumerate_uniq([1, 1, 1, 1, 1], [2, 1, 2, 1, 2], [3, 1, 3, 1, 3]); +----------------------------------------------------------------------------------------+ | array_enumerate_uniq(ARRAY(1, 1, 1, 1, 1), ARRAY(2, 1, 2, 1, 2), ARRAY(3, 1, 3, 1, 3)) | +----------------------------------------------------------------------------------------+ -| [1, 1, 2, 1, 3] | +| [1, 1, 2, 2, 3] | +----------------------------------------------------------------------------------------+ ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-exists-path.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-exists-path.md index 96e4c43e1f30e..cd22905ae0e13 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-exists-path.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-exists-path.md @@ -23,8 +23,8 @@ JSON_EXISTS_PATH (, ) ## 参数 | 参数 | 描述 | |--------------|--------------------------------------------------------| -| `` | 要包含在 JSON 数组中的元素。可以是任意类型的值,包括`NULL`。如果没有指定元素,则返回一个空数组。 -| `` | 要插入的 JSON 路径。如果是 `NULL` ,则返回 NULL | +| `` | 要检查的 JSON 字符串。如果是 `NULL`,则返回 NULL | +| `` | 要判断是否存在的 JSON 路径。如果是 `NULL`,则返回 NULL | ## 返回值 如果存在返回 TRUE,不存在返回 FALSE diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-type.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-type.md index 94ad0a97ecf21..f5d7d51996801 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-type.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-type.md @@ -23,7 +23,7 @@ ## 语法 ```sql -STRING JSON_TYPE( ) +STRING JSON_TYPE( , ) ``` ## 别名 @@ -35,6 +35,7 @@ STRING JSON_TYPE( ) | 参数 | 描述 | |------|------| | `` | 需要检查类型的 JSON 字符串。 | +| `` | 要检查类型的字段的 JSON 路径。 | ## 返回值 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/string-functions/elt.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/string-functions/elt.md index 58deaa4b40119..1449155762e55 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/string-functions/elt.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/string-functions/elt.md @@ -34,13 +34,13 @@ ELT ( , [ , ] ) ## 举例 ```sql -SELECT ELT(1, 'aaa', 'bbb'),ELT(2, 'aaa', 'bbb'), ELT(0, 'aaa', 'bbb'),ELT(2, 'aaa', 'bbb') +SELECT ELT(1, 'aaa', 'bbb'), ELT(2, 'aaa', 'bbb'), ELT(0, 'aaa', 'bbb') ``` ```text -+----------------------+----------------------+----------------------+----------------------+ -| elt(1, 'aaa', 'bbb') | elt(2, 'aaa', 'bbb') | elt(0, 'aaa', 'bbb') | elt(2, 'aaa', 'bbb') | -+----------------------+----------------------+----------------------+----------------------+ -| aaa | bbb | NULL | bbb | -+----------------------+----------------------+----------------------+----------------------+ ++----------------------+----------------------+----------------------+ +| elt(1, 'aaa', 'bbb') | elt(2, 'aaa', 'bbb') | elt(0, 'aaa', 'bbb') | ++----------------------+----------------------+----------------------+ +| aaa | bbb | NULL | ++----------------------+----------------------+----------------------+ ``` \ No newline at end of file