This is an automated email from the ASF dual-hosted git repository. lihaopeng 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 0ef751b3a7d add array flatten (#1951) 0ef751b3a7d is described below commit 0ef751b3a7da63705b92df048a5f33b410ee47c1 Author: Pxl <pxl...@qq.com> AuthorDate: Mon Jan 27 23:05:26 2025 +0800 add array flatten (#1951) ## Versions - [X] dev - [ ] 3.0 - [ ] 2.1 - [ ] 2.0 ## Languages - [X] Chinese - [X] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built --- .../array-functions/array-flatten.md | 63 ++++++++++++++++++++++ .../array-functions/array-flatten.md | 63 ++++++++++++++++++++++ sidebars.json | 1 + 3 files changed, 127 insertions(+) diff --git a/docs/sql-manual/sql-functions/scalar-functions/array-functions/array-flatten.md b/docs/sql-manual/sql-functions/scalar-functions/array-functions/array-flatten.md new file mode 100644 index 00000000000..1d29c2c2a05 --- /dev/null +++ b/docs/sql-manual/sql-functions/scalar-functions/array-functions/array-flatten.md @@ -0,0 +1,63 @@ +--- +{ + "title": "ARRAY_FLATTEN", + "language": "en" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +## array_flatten + +array_flatten + +### description + +#### Syntax + +```sql +ARRAY<T> array_flatten(ARRAY<ARRAY<T>> array1) +``` + +Flatten a multidimensional array into one dimension. + +### example + +```sql +mysql> select array_flatten([[1,2,3],[4,5]]); ++--------------------------------+ +| array_flatten([[1,2,3],[4,5]]) | ++--------------------------------+ +| [1, 2, 3, 4, 5] | ++--------------------------------+ +1 row in set (0.01 sec) + +mysql> select array_flatten([[[[[[1,2,3,4,5],[6,7],[8,9],[10,11],[12]],[[13]]],[[[14]]]]]]); ++-------------------------------------------------------------------------------+ +| array_flatten([[[[[[1,2,3,4,5],[6,7],[8,9],[10,11],[12]],[[13]]],[[[14]]]]]]) | ++-------------------------------------------------------------------------------+ +| [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | ++-------------------------------------------------------------------------------+ +1 row in set (0.02 sec) +``` + +### keywords + +ARRAY,ARRAY_FLATTEN diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-flatten.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-flatten.md new file mode 100644 index 00000000000..71df5283691 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-flatten.md @@ -0,0 +1,63 @@ +--- +{ + "title": "ARRAY_FLATTEN", + "language": "zh-CN" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +## array_flatten + +array_flatten + +## 描述 + +## 语法 + +```sql +ARRAY<T> array_flatten(ARRAY<ARRAY<T>> array1) +``` + +将多维数组展平成一维。 + +## 举例 + +```sql +mysql> select array_flatten([[1,2,3],[4,5]]); ++--------------------------------+ +| array_flatten([[1,2,3],[4,5]]) | ++--------------------------------+ +| [1, 2, 3, 4, 5] | ++--------------------------------+ +1 row in set (0.01 sec) + +mysql> select array_flatten([[[[[[1,2,3,4,5],[6,7],[8,9],[10,11],[12]],[[13]]],[[[14]]]]]]); ++-------------------------------------------------------------------------------+ +| array_flatten([[[[[[1,2,3,4,5],[6,7],[8,9],[10,11],[12]],[[13]]],[[[14]]]]]]) | ++-------------------------------------------------------------------------------+ +| [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | ++-------------------------------------------------------------------------------+ +1 row in set (0.02 sec) +``` + +### keywords + +ARRAY,ARRAY_FLATTEN diff --git a/sidebars.json b/sidebars.json index 87cecff3af8..5089d728394 100644 --- a/sidebars.json +++ b/sidebars.json @@ -1221,6 +1221,7 @@ "sql-manual/sql-functions/scalar-functions/array-functions/array-first-index", "sql-manual/sql-functions/scalar-functions/array-functions/array-last-index", "sql-manual/sql-functions/scalar-functions/array-functions/array-first", + "sql-manual/sql-functions/scalar-functions/array-functions/array-flatten", "sql-manual/sql-functions/scalar-functions/array-functions/array-last", "sql-manual/sql-functions/scalar-functions/array-functions/arrays-overlap", "sql-manual/sql-functions/scalar-functions/array-functions/array-count", --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org