This is an automated email from the ASF dual-hosted git repository. kassiez 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 ba0a57eec06 [doc] Fix json_array zh_doc (#1809) ba0a57eec06 is described below commit ba0a57eec0600677c647c7cbbe0ef799003b0c5a Author: mklzl <36362816+mk...@users.noreply.github.com> AuthorDate: Mon Jan 20 12:32:12 2025 +0800 [doc] Fix json_array zh_doc (#1809) Fix json_array zh_doc ## Versions - [x] dev - [x] 3.0 - [x] 2.1 - [ ] 2.0 ## Languages - [x] Chinese - [ ] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built --- .../scalar-functions/json-functions/json-array.md | 46 +++++++++++++++++----- .../scalar-functions/json-functions/json-array.md | 46 +++++++++++++++++----- .../scalar-functions/json-functions/json-array.md | 46 +++++++++++++++++----- 3 files changed, 108 insertions(+), 30 deletions(-) diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md index 2b418ae1e17..a134cca9cd6 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md @@ -24,47 +24,73 @@ specific language governing permissions and limitations under the License. --> -## json_array ## 描述 + +生成一个包含制定元素的 json 数组,未指定时返回空数组 + ## 语法 -`VARCHAR json_array(VARCHAR,...)` +```sql +JSON_ARRAY(<a>, ...) +``` + +## 参数 +| 参数 | 描述 | +|------|------------------------------------------------------------| +| `<a>, ...` | 要包含在 JSON 数组中的元素。可以是单个或者多个任意类型的值,包括`NULL`。如果没有指定元素,则返回一个空数组。 | -生成一个包含指定元素的json数组,未指定时返回空数组 +## 返回值 -## 举例 +返回一个包含指定元素的 JSON 数组。特殊情况: +* 如果指定的元素为`NULL`,则返回`NULL`。 +## 示例 + +```sql +select json_array(); ``` -MySQL> select json_array(); + +```text +--------------+ | json_array() | +--------------+ | [] | +--------------+ +``` -MySQL> select json_array(null); +```sql +select json_array(null); +``` + +```text +--------------------+ | json_array('NULL') | +--------------------+ | [NULL] | +--------------------+ +``` +```sql +SELECT json_array(1, "abc", NULL, TRUE, CURTIME()); +``` -MySQL> SELECT json_array(1, "abc", NULL, TRUE, CURTIME()); +```text +-----------------------------------------------+ | json_array(1, 'abc', 'NULL', TRUE, curtime()) | +-----------------------------------------------+ | [1, "abc", NULL, TRUE, "10:41:15"] | +-----------------------------------------------+ +``` +```sql +select json_array("a", null, "c"); +``` -MySQL> select json_array("a", null, "c"); +```text +------------------------------+ | json_array('a', 'NULL', 'c') | +------------------------------+ | ["a", NULL, "c"] | +------------------------------+ ``` -### keywords -json,array,json_array diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md index 2b418ae1e17..b4b7568b140 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md @@ -24,47 +24,73 @@ specific language governing permissions and limitations under the License. --> -## json_array ## 描述 + +生成一个包含制定元素的 json 数组,未指定时返回空数组 + ## 语法 -`VARCHAR json_array(VARCHAR,...)` +```sql +JSON_ARRAY(<a>, ...) +``` + +## 参数 +| 参数 | 描述 | +|------|------------------------------------------------------------| +| `<a>, ...` | 要包含在 JSON 数组中的元素。可以是单个或者多个任意类型的值,包括`NULL`。如果没有指定元素,则返回一个空数组。 | -生成一个包含指定元素的json数组,未指定时返回空数组 +## 返回值 -## 举例 +返回一个包含指定元素的 JSON 数组。特殊情况: +* 如果指定的元素为`NULL`,则返回`NULL`。 +## 示例 + +```sql +select json_array(); ``` -MySQL> select json_array(); + +```text +--------------+ | json_array() | +--------------+ | [] | +--------------+ +``` -MySQL> select json_array(null); +```sql +select json_array(null); +``` + +```text +--------------------+ | json_array('NULL') | +--------------------+ | [NULL] | +--------------------+ +``` +```sql +SELECT json_array(1, "abc", NULL, TRUE, CURTIME()); +``` -MySQL> SELECT json_array(1, "abc", NULL, TRUE, CURTIME()); +```text +-----------------------------------------------+ | json_array(1, 'abc', 'NULL', TRUE, curtime()) | +-----------------------------------------------+ | [1, "abc", NULL, TRUE, "10:41:15"] | +-----------------------------------------------+ +``` +```sql +select json_array("a", null, "c"); +``` -MySQL> select json_array("a", null, "c"); +```text +------------------------------+ | json_array('a', 'NULL', 'c') | +------------------------------+ | ["a", NULL, "c"] | +------------------------------+ ``` -### keywords -json,array,json_array diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md index 2b418ae1e17..b4b7568b140 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/json-functions/json-array.md @@ -24,47 +24,73 @@ specific language governing permissions and limitations under the License. --> -## json_array ## 描述 + +生成一个包含制定元素的 json 数组,未指定时返回空数组 + ## 语法 -`VARCHAR json_array(VARCHAR,...)` +```sql +JSON_ARRAY(<a>, ...) +``` + +## 参数 +| 参数 | 描述 | +|------|------------------------------------------------------------| +| `<a>, ...` | 要包含在 JSON 数组中的元素。可以是单个或者多个任意类型的值,包括`NULL`。如果没有指定元素,则返回一个空数组。 | -生成一个包含指定元素的json数组,未指定时返回空数组 +## 返回值 -## 举例 +返回一个包含指定元素的 JSON 数组。特殊情况: +* 如果指定的元素为`NULL`,则返回`NULL`。 +## 示例 + +```sql +select json_array(); ``` -MySQL> select json_array(); + +```text +--------------+ | json_array() | +--------------+ | [] | +--------------+ +``` -MySQL> select json_array(null); +```sql +select json_array(null); +``` + +```text +--------------------+ | json_array('NULL') | +--------------------+ | [NULL] | +--------------------+ +``` +```sql +SELECT json_array(1, "abc", NULL, TRUE, CURTIME()); +``` -MySQL> SELECT json_array(1, "abc", NULL, TRUE, CURTIME()); +```text +-----------------------------------------------+ | json_array(1, 'abc', 'NULL', TRUE, curtime()) | +-----------------------------------------------+ | [1, "abc", NULL, TRUE, "10:41:15"] | +-----------------------------------------------+ +``` +```sql +select json_array("a", null, "c"); +``` -MySQL> select json_array("a", null, "c"); +```text +------------------------------+ | json_array('a', 'NULL', 'c') | +------------------------------+ | ["a", NULL, "c"] | +------------------------------+ ``` -### keywords -json,array,json_array --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org