From 72236d2b083fc7d3fb9de8c9cfaff0d66fb609ea Mon Sep 17 00:00:00 2001 From: "jiafeng.zhang" Date: Fri, 14 Apr 2023 09:04:55 +0800 Subject: [PATCH] [typo](docs) add row to column doc (#18546) * [typo](docs) add row to column doc --- docs/en/docs/advanced/cold_hot_separation.md | 4 +- docs/en/docs/advanced/lateral-view.md | 94 +++++++++++++++++++ docs/en/docs/advanced/nereids.md | 2 +- .../advanced/pipeline-execution-engine.md | 4 +- .../docs/data-table/dynamic-schema-table.md | 2 +- .../docs/data-table/index/inverted-index.md | 4 +- .../index/ngram-bloomfilter-index.md | 2 +- docs/sidebars.json | 3 +- .../docs/advanced/cold_hot_separation.md | 2 +- docs/zh-CN/docs/advanced/lateral-view.md | 94 +++++++++++++++++++ docs/zh-CN/docs/advanced/nereids.md | 2 +- .../advanced/pipeline-execution-engine.md | 4 +- .../docs/data-table/index/inverted-index.md | 2 +- .../index/ngram-bloomfilter-index.md | 2 +- 14 files changed, 205 insertions(+), 16 deletions(-) create mode 100644 docs/en/docs/advanced/lateral-view.md create mode 100644 docs/zh-CN/docs/advanced/lateral-view.md diff --git a/docs/en/docs/advanced/cold_hot_separation.md b/docs/en/docs/advanced/cold_hot_separation.md index 63d1617b8f..e88d0954f4 100644 --- a/docs/en/docs/advanced/cold_hot_separation.md +++ b/docs/en/docs/advanced/cold_hot_separation.md @@ -1,6 +1,6 @@ --- { -"title": "cold hot separation", +"title": "Cold hot separation", "language": "en" } --- @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# cold hot separation +# [Experimental] Cold hot separation ## Demand scenario diff --git a/docs/en/docs/advanced/lateral-view.md b/docs/en/docs/advanced/lateral-view.md new file mode 100644 index 0000000000..4f8868c6da --- /dev/null +++ b/docs/en/docs/advanced/lateral-view.md @@ -0,0 +1,94 @@ +--- +{ + "title": "Row to column", + "language": "en" +} +--- + + + +# Row to column + +Used in conjunction with generator functions such as `EXPLODE`, will generate a virtual table containing one or more rows. `LATERAL VIEW` applies rows to each raw output row. + +## Grammar + +```sql +LATERAL VIEW generator_function ( expression [, ...] ) [ table_identifier ] AS column_identifier [, ...] +``` + +## Parameters + +- generator_function + + Generator functions (EXPLODE, EXPLODE_SPLIT, etc.). + +- table_identifier + + Alias for `generator_function`, which is optional. + +- column_identifier + + List column alias `generator_function`, which can be used to output rows. The number of column identifiers must match the number of columns returned by the generator function. + +## Example + +```sql +CREATE TABLE `person` ( + `id` int(11) NULL, + `name` text NULL, + `age` int(11) NULL, + `class` int(11) NULL, + `address` text NULL +) ENGINE=OLAP +UNIQUE KEY(`id`) +COMMENT 'OLAP' +DISTRIBUTED BY HASH(`id`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2", +"disable_auto_compaction" = "false" +); + +NSERT INTO person VALUES + (100, 'John', 30, 1, 'Street 1'), + (200, 'Mary', NULL, 1, 'Street 2'), + (300, 'Mike', 80, 3, 'Street 3'), + (400, 'Dan', 50, 4, 'Street 4'); + +mysql> SELECT * FROM person + -> LATERAL VIEW EXPLODE(ARRAY(30, 60)) tableName AS c_age; ++------+------+------+-------+----------+-------+ +| id | name | age | class | address | c_age | ++------+------+------+-------+----------+-------+ +| 100 | John | 30 | 1 | Street 1 | 30 | +| 100 | John | 30 | 1 | Street 1 | 60 | +| 200 | Mary | NULL | 1 | Street 2 | 30 | +| 200 | Mary | NULL | 1 | Street 2 | 60 | +| 300 | Mike | 80 | 3 | Street 3 | 30 | +| 300 | Mike | 80 | 3 | Street 3 | 60 | +| 400 | Dan | 50 | 4 | Street 4 | 30 | +| 400 | Dan | 50 | 4 | Street 4 | 60 | ++------+------+------+-------+----------+-------+ +8 rows in set (0.12 sec) + +``` + diff --git a/docs/en/docs/advanced/nereids.md b/docs/en/docs/advanced/nereids.md index 140523321b..b66c0c3317 100644 --- a/docs/en/docs/advanced/nereids.md +++ b/docs/en/docs/advanced/nereids.md @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# Nereids +# [Experimental] Nereids diff --git a/docs/en/docs/advanced/pipeline-execution-engine.md b/docs/en/docs/advanced/pipeline-execution-engine.md index 9edbc3b9be..a3aff7e527 100644 --- a/docs/en/docs/advanced/pipeline-execution-engine.md +++ b/docs/en/docs/advanced/pipeline-execution-engine.md @@ -1,6 +1,6 @@ --- { - "title": "[Experimental] Pipeline execution engine", + "title": "Pipeline execution engine", "language": "en" } --- @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# Pipeline Execution Engine +# [Experimental] Pipeline Execution Engine diff --git a/docs/en/docs/data-table/dynamic-schema-table.md b/docs/en/docs/data-table/dynamic-schema-table.md index 323ee4d776..ffb788bebf 100644 --- a/docs/en/docs/data-table/dynamic-schema-table.md +++ b/docs/en/docs/data-table/dynamic-schema-table.md @@ -1,6 +1,6 @@ --- { - "title": "dynamie schema table", + "title": "[Experimental] Dynamie schema table", "language": "en" } --- diff --git a/docs/en/docs/data-table/index/inverted-index.md b/docs/en/docs/data-table/index/inverted-index.md index e7ca3c6ef9..34f2b4a258 100644 --- a/docs/en/docs/data-table/index/inverted-index.md +++ b/docs/en/docs/data-table/index/inverted-index.md @@ -1,6 +1,6 @@ --- { - "title": "inverted index", + "title": "Inverted index", "language": "en" } --- @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# Inverted Index +# [Experimental] Inverted Index diff --git a/docs/en/docs/data-table/index/ngram-bloomfilter-index.md b/docs/en/docs/data-table/index/ngram-bloomfilter-index.md index ae8c051767..e3e04eb315 100644 --- a/docs/en/docs/data-table/index/ngram-bloomfilter-index.md +++ b/docs/en/docs/data-table/index/ngram-bloomfilter-index.md @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# Doris NGram BloomFilter Index +# [Experimental] NGram BloomFilter Index diff --git a/docs/sidebars.json b/docs/sidebars.json index 14eef84e91..7b5dd3a762 100644 --- a/docs/sidebars.json +++ b/docs/sidebars.json @@ -185,7 +185,8 @@ "advanced/cold_hot_separation", "advanced/compute_node", "advanced/hight-concurrent-point-query", - "advanced/nereids" + "advanced/nereids", + "advanced/lateral-view" ] }, { diff --git a/docs/zh-CN/docs/advanced/cold_hot_separation.md b/docs/zh-CN/docs/advanced/cold_hot_separation.md index 1b62176a69..8e13bee8dd 100644 --- a/docs/zh-CN/docs/advanced/cold_hot_separation.md +++ b/docs/zh-CN/docs/advanced/cold_hot_separation.md @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# 冷热分离 +# [Experimental] 冷热分离 ## 需求场景 diff --git a/docs/zh-CN/docs/advanced/lateral-view.md b/docs/zh-CN/docs/advanced/lateral-view.md new file mode 100644 index 0000000000..c52977a053 --- /dev/null +++ b/docs/zh-CN/docs/advanced/lateral-view.md @@ -0,0 +1,94 @@ +--- +{ + "title": "行转列", + "language": "zh-CN" +} +--- + + + +# 行转列 + +与生成器函数(例如 `EXPLODE`)结合使用,将生成包含一个或多个行的虚拟表。 `LATERAL VIEW` 将行应用于每个原始输出行。 + +## 语法 + +```sql +LATERAL VIEW generator_function ( expression [, ...] ) [ table_identifier ] AS column_identifier [, ...] +``` + +## 参数 + +- generator_function + + 生成器函数(EXPLODE、EXPLODE_SPLIT 等)。 + +- table_identifier + + `generator_function` 的别名,它是可选项。 + +- column_identifier + + 列出列别名 `generator_function`,它可用于输出行。 列标识符的数目必须与 generator 函数返回的列数匹配。 + +## 示例 + +```sql +CREATE TABLE `person` ( + `id` int(11) NULL, + `name` text NULL, + `age` int(11) NULL, + `class` int(11) NULL, + `address` text NULL +) ENGINE=OLAP +UNIQUE KEY(`id`) +COMMENT 'OLAP' +DISTRIBUTED BY HASH(`id`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2", +"disable_auto_compaction" = "false" +); + +NSERT INTO person VALUES + (100, 'John', 30, 1, 'Street 1'), + (200, 'Mary', NULL, 1, 'Street 2'), + (300, 'Mike', 80, 3, 'Street 3'), + (400, 'Dan', 50, 4, 'Street 4'); + +mysql> SELECT * FROM person + -> LATERAL VIEW EXPLODE(ARRAY(30, 60)) tableName AS c_age; ++------+------+------+-------+----------+-------+ +| id | name | age | class | address | c_age | ++------+------+------+-------+----------+-------+ +| 100 | John | 30 | 1 | Street 1 | 30 | +| 100 | John | 30 | 1 | Street 1 | 60 | +| 200 | Mary | NULL | 1 | Street 2 | 30 | +| 200 | Mary | NULL | 1 | Street 2 | 60 | +| 300 | Mike | 80 | 3 | Street 3 | 30 | +| 300 | Mike | 80 | 3 | Street 3 | 60 | +| 400 | Dan | 50 | 4 | Street 4 | 30 | +| 400 | Dan | 50 | 4 | Street 4 | 60 | ++------+------+------+-------+----------+-------+ +8 rows in set (0.12 sec) + +``` + diff --git a/docs/zh-CN/docs/advanced/nereids.md b/docs/zh-CN/docs/advanced/nereids.md index d1e8b831cf..562726f6ad 100644 --- a/docs/zh-CN/docs/advanced/nereids.md +++ b/docs/zh-CN/docs/advanced/nereids.md @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# 新优化器 +# [Experimental] 新优化器 diff --git a/docs/zh-CN/docs/advanced/pipeline-execution-engine.md b/docs/zh-CN/docs/advanced/pipeline-execution-engine.md index 762823ab3b..ecbaaebeb5 100644 --- a/docs/zh-CN/docs/advanced/pipeline-execution-engine.md +++ b/docs/zh-CN/docs/advanced/pipeline-execution-engine.md @@ -1,6 +1,6 @@ --- { - "title": "[Experimental] Pipeline执行引擎", + "title": "Pipeline执行引擎", "language": "zh-CN" } --- @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# Pipeline执行引擎 +# [Experimental] Pipeline执行引擎 diff --git a/docs/zh-CN/docs/data-table/index/inverted-index.md b/docs/zh-CN/docs/data-table/index/inverted-index.md index 665aa5706c..a624d31fa5 100644 --- a/docs/zh-CN/docs/data-table/index/inverted-index.md +++ b/docs/zh-CN/docs/data-table/index/inverted-index.md @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# 倒排索引 +# [Experimental] 倒排索引 diff --git a/docs/zh-CN/docs/data-table/index/ngram-bloomfilter-index.md b/docs/zh-CN/docs/data-table/index/ngram-bloomfilter-index.md index 6cbda14769..ea6304253a 100644 --- a/docs/zh-CN/docs/data-table/index/ngram-bloomfilter-index.md +++ b/docs/zh-CN/docs/data-table/index/ngram-bloomfilter-index.md @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# Doris NGram BloomFilter索引及使用使用场景 +# [Experimental] NGram BloomFilter索引及使用使用场景