From dbd7d5a08600793c3570ee0e7bb26e0a48225a64 Mon Sep 17 00:00:00 2001 From: Aylei Date: Tue, 14 Jun 2022 21:19:29 +0800 Subject: [PATCH] docs: add markdownlint rules for mo docs (#2994) * docs: add markdownlint rules for mo docs Signed-off-by: Aylei * docs: add lint docs github action Signed-off-by: Aylei * docs: better check name Signed-off-by: Aylei * docs: fix docs automatically using markdown-lint Signed-off-by: Aylei * fix markdown lint rule file path Signed-off-by: Aylei * docs: fix link of cube auto-rebalance Signed-off-by: Aylei --- .github/workflows/lint_docs.yml | 24 +++ .markdownlint.yaml | 56 +++++++ .../Code-Style/code-comment-style.md | 3 - .../Code-Style/code-of-conduct.md | 10 +- .../Code-Style/commit-pr-style.md | 4 +- .../How-to-Contribute/contribute-code.md | 18 ++- .../contribute-documentation.md | 19 ++- .../How-to-Contribute/make-a-design.md | 3 +- .../How-to-Contribute/preparation.md | 21 ++- .../How-to-Contribute/report-an-issue.md | 7 +- .../review-a-pull-request.md | 6 +- .../types-of-contributions.md | 2 +- .../make-your-first-contribution.md | 35 ++++- .../cn/MatrixOne/Develop/design-a-database.md | 1 - docs/cn/MatrixOne/FAQs/general-faqs.md | 1 - docs/cn/MatrixOne/Get-Started/Playground.md | 12 +- .../Tutorial/NYC-test-with-matrixone.md | 7 +- .../Tutorial/SSB-test-with-matrixone.md | 6 +- .../connect-to-matrixone-server.md | 5 +- .../install-distributed-matrixone.md | 19 ++- .../install-standalone-matrixone.md | 10 ++ docs/cn/MatrixOne/MatrixCampEvent.md | 139 +++++++++--------- .../matrixone-techdesign.md | 9 +- .../Overview/NYC-Test-Performance.md | 6 +- .../Overview/SSB-Test-Performance.md | 8 +- .../matrixcube-auto-rebalance-scheduling.md | 3 +- .../matrixcube/matrixcube-introduction.md | 22 +-- .../matrixcube/matrixcube-proxy-routing.md | 6 +- .../matrixcube/matrixcube-shard-splitting.md | 2 - .../Overview/matrixone-architecture.md | 7 +- .../Overview/matrixone-introduction.md | 11 +- .../MatrixOne/Overview/mysql-compatibility.md | 7 - docs/cn/MatrixOne/Overview/whats-new.md | 1 + .../Builtin-Functions/Datetime/date.md | 5 +- .../Builtin-Functions/Datetime/dayofyear.md | 5 +- .../Builtin-Functions/Datetime/month.md | 7 +- .../Datetime/utc_timestamp.md | 2 +- .../Builtin-Functions/Datetime/weekday.md | 5 +- .../Builtin-Functions/Datetime/year.md | 7 +- .../Builtin-Functions/Mathematical/abs.md | 4 +- .../Builtin-Functions/Mathematical/acos.md | 5 +- .../Builtin-Functions/Mathematical/atan.md | 5 +- .../Builtin-Functions/Mathematical/ceil.md | 8 +- .../Builtin-Functions/Mathematical/cos.md | 6 +- .../Builtin-Functions/Mathematical/cot.md | 6 +- .../Builtin-Functions/Mathematical/exp.md | 6 +- .../Builtin-Functions/Mathematical/floor.md | 8 +- .../Builtin-Functions/Mathematical/ln.md | 1 - .../Builtin-Functions/Mathematical/log.md | 5 +- .../Builtin-Functions/Mathematical/pi.md | 4 +- .../Builtin-Functions/Mathematical/power.md | 6 +- .../Builtin-Functions/Mathematical/round.md | 5 +- .../Builtin-Functions/Mathematical/sin.md | 4 +- .../Builtin-Functions/Mathematical/sinh.md | 4 +- .../Builtin-Functions/Mathematical/tan.md | 7 +- .../Builtin-Functions/String/empty.md | 5 +- .../Builtin-Functions/String/endswith.md | 5 +- .../Builtin-Functions/String/length.md | 6 +- .../Builtin-Functions/String/lengthUTF8.md | 6 +- .../Builtin-Functions/String/lpad.md | 5 +- .../Builtin-Functions/String/ltrim.md | 5 +- .../Builtin-Functions/String/reverse.md | 6 +- .../Builtin-Functions/String/rpad.md | 5 +- .../Builtin-Functions/String/rtrim.md | 5 +- .../Builtin-Functions/String/space.md | 7 +- .../Builtin-Functions/String/startswith.md | 4 + .../Builtin-Functions/String/substring.md | 5 +- .../Reference/Data-Types/data-types.md | 3 - .../Reference/Data-Types/fixed-point-types.md | 3 - .../SQL-Reference/Aggregate-Functions/avg.md | 7 +- .../Aggregate-Functions/bit_and.md | 4 +- .../Aggregate-Functions/bit_or.md | 4 +- .../Aggregate-Functions/bit_xor.md | 4 +- .../Aggregate-Functions/count.md | 10 +- .../SQL-Reference/Aggregate-Functions/max.md | 6 +- .../SQL-Reference/Aggregate-Functions/min.md | 5 +- .../Aggregate-Functions/stddev_pop.md | 6 +- .../SQL-Reference/Aggregate-Functions/sum.md | 7 +- .../SQL-Reference/Aggregate-Functions/var.md | 6 +- .../create-database.md | 4 +- .../create-index.md | 3 +- .../create-table.md | 4 +- .../drop-database.md | 4 +- .../Data-Definition-Statements/drop-index.md | 5 +- .../Data-Definition-Statements/drop-table.md | 4 +- .../Data-Definition-Statements/primary-key.md | 9 +- .../Data-Manipulation-Statements/cast.md | 9 +- .../Data-Manipulation-Statements/in.md | 5 +- .../inner-join.md | 7 +- .../Data-Manipulation-Statements/insert.md | 1 + .../Data-Manipulation-Statements/like.md | 5 + .../Data-Manipulation-Statements/load-data.md | 5 +- .../Data-Manipulation-Statements/select.md | 7 +- .../show-databases.md | 5 +- .../show-tables.md | 5 + .../Data-Manipulation-Statements/subquery.md | 3 + .../Data-Manipulation-Statements/use.md | 4 + .../configuration-settings.md | 6 +- .../System-Parameters/distributed-settings.md | 27 ++-- docs/cn/MatrixOne/Release-Notes/v0.1.0.md | 15 +- docs/cn/MatrixOne/Release-Notes/v0.2.0.md | 4 +- docs/cn/MatrixOne/Release-Notes/v0.3.0.md | 15 +- docs/cn/MatrixOne/Release-Notes/v0.4.0.md | 7 +- docs/cn/MatrixOne/glossary.md | 3 - docs/cn/README.md | 2 +- .../Code-Style/code-of-conduct.md | 4 +- .../Code-Style/commit-pr-style.md | 2 +- .../How-to-Contribute/contribute-code.md | 15 +- .../contribute-documentation.md | 25 ++-- .../How-to-Contribute/make-a-design.md | 4 +- .../How-to-Contribute/preparation.md | 22 +-- .../How-to-Contribute/report-an-issue.md | 8 +- .../review-a-pull-request.md | 4 +- .../Tutorial/develop_aggregate_functions.md | 42 ++---- .../Tutorial/develop_builtin_functions.md | 13 ++ .../make-your-first-contribution.md | 35 ++++- .../Develop/develop_python_application.md | 4 - docs/en/MatrixOne/FAQs/general-faqs.md | 2 +- docs/en/MatrixOne/Get-Started/Playground.md | 14 +- .../Tutorial/NYC-test-with-matrixone.md | 7 +- .../Tutorial/SSB-test-with-matrixone.md | 7 +- .../install-distributed-matrixone.md | 22 ++- .../install-standalone-matrixone.md | 8 +- .../matrixone-techdesign.md | 16 +- .../Overview/NYC Test Performance.md | 11 +- .../Overview/SSB Test Performance.md | 16 +- .../matrixcube-auto-rebalance-scheduling.md | 1 - .../matrixcube/matrixcube-introduction.md | 15 -- .../matrixcube/matrixcube-proxy-routing.md | 3 +- .../matrixcube/matrixcube-shard-splitting.md | 1 - .../Overview/matrixone-architecture.md | 10 +- .../Overview/matrixone-introduction.md | 10 +- .../MatrixOne/Overview/mysql-compatibility.md | 18 +-- .../Builtin-Functions/Datetime/date.md | 6 +- .../Builtin-Functions/Datetime/dayofyear.md | 5 +- .../Builtin-Functions/Datetime/month.md | 6 +- .../Datetime/utc_timestamp.md | 1 - .../Builtin-Functions/Datetime/weekday.md | 6 +- .../Builtin-Functions/Datetime/year.md | 6 +- .../Builtin-Functions/Mathematical/abs.md | 4 +- .../Builtin-Functions/Mathematical/acos.md | 5 +- .../Builtin-Functions/Mathematical/atan.md | 5 +- .../Builtin-Functions/Mathematical/ceil.md | 9 +- .../Builtin-Functions/Mathematical/cos.md | 5 +- .../Builtin-Functions/Mathematical/cot.md | 5 +- .../Builtin-Functions/Mathematical/exp.md | 6 +- .../Builtin-Functions/Mathematical/floor.md | 6 +- .../Builtin-Functions/Mathematical/ln.md | 1 - .../Builtin-Functions/Mathematical/log.md | 5 +- .../Builtin-Functions/Mathematical/pi.md | 4 +- .../Builtin-Functions/Mathematical/power.md | 6 +- .../Builtin-Functions/Mathematical/round.md | 6 +- .../Builtin-Functions/Mathematical/sin.md | 5 +- .../Builtin-Functions/Mathematical/sinh.md | 5 +- .../Builtin-Functions/Mathematical/tan.md | 5 +- .../Builtin-Functions/String/empty.md | 7 +- .../Builtin-Functions/String/endswith.md | 4 + .../Builtin-Functions/String/length.md | 7 +- .../Builtin-Functions/String/lengthUTF8.md | 7 +- .../Builtin-Functions/String/lpad.md | 5 +- .../Builtin-Functions/String/ltrim.md | 5 +- .../Builtin-Functions/String/reverse.md | 7 +- .../Builtin-Functions/String/rpad.md | 5 +- .../Builtin-Functions/String/rtrim.md | 5 +- .../Builtin-Functions/String/space.md | 8 +- .../Builtin-Functions/String/startswith.md | 4 + .../Builtin-Functions/String/substring.md | 5 +- .../Reference/Data-Types/data-types.md | 2 - .../Reference/Data-Types/fixed-point-types.md | 3 - .../SQL-Reference/Aggregate-Functions/avg.md | 5 +- .../Aggregate-Functions/bit_and.md | 4 +- .../Aggregate-Functions/bit_or.md | 4 +- .../Aggregate-Functions/bit_xor.md | 4 +- .../Aggregate-Functions/count.md | 5 +- .../SQL-Reference/Aggregate-Functions/max.md | 4 +- .../SQL-Reference/Aggregate-Functions/min.md | 4 +- .../Aggregate-Functions/stddev_pop.md | 4 +- .../SQL-Reference/Aggregate-Functions/sum.md | 4 +- .../SQL-Reference/Aggregate-Functions/var.md | 4 +- .../create-database.md | 4 +- .../create-index.md | 3 +- .../create-table.md | 4 +- .../drop-database.md | 4 +- .../Data-Definition-Statements/drop-index.md | 3 +- .../Data-Definition-Statements/drop-table.md | 4 +- .../Data-Definition-Statements/primary-key.md | 3 +- .../Data-Manipulation-Statements/cast.md | 11 +- .../Data-Manipulation-Statements/in.md | 7 +- .../inner-join.md | 6 +- .../Data-Manipulation-Statements/insert.md | 1 + .../Data-Manipulation-Statements/like.md | 4 + .../Data-Manipulation-Statements/load-data.md | 2 + .../Data-Manipulation-Statements/select.md | 7 +- .../show-databases.md | 4 +- .../show-tables.md | 4 + .../Data-Manipulation-Statements/subquery.md | 3 + .../Data-Manipulation-Statements/use.md | 4 + .../configuration-settings.md | 5 - .../System-Parameters/distributed-settings.md | 5 - docs/en/MatrixOne/Release-Notes/v0.1.0.md | 15 +- docs/en/MatrixOne/Release-Notes/v0.2.0.md | 4 +- docs/en/MatrixOne/Release-Notes/v0.3.0.md | 17 ++- docs/en/MatrixOne/Release-Notes/v0.4.0.md | 8 +- docs/en/MatrixOne/glossary.md | 8 +- 204 files changed, 945 insertions(+), 664 deletions(-) create mode 100644 .github/workflows/lint_docs.yml create mode 100644 .markdownlint.yaml diff --git a/.github/workflows/lint_docs.yml b/.github/workflows/lint_docs.yml new file mode 100644 index 0000000000000..a7655ae23027d --- /dev/null +++ b/.github/workflows/lint_docs.yml @@ -0,0 +1,24 @@ +name: Lint Docs + +on: + pull_request: + types: [ opened, synchronize, reopened ] + branches: [main] + paths: + - 'docs/cn/**' + - 'docs/en/**' + workflow_dispatch: + +jobs: + lint-docs: + name: Lint Docs + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Lint docs + uses: docker://avtodev/markdown-lint:v1 # fastest way + with: + config: './.markdownlint.yaml' + args: './docs/cn ./docs/en' \ No newline at end of file diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000000000..41a1ff8218384 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,56 @@ +# disable all by default +default: false + +# MD003 +heading-style: + style: atx + +# MD012 +no-multiple-blanks: true + +# MD018 +no-missing-space-atx: true + +# MD019 +no-multiple-space-atx: true + +# MD022 +blanks-around-headings: true + +# MD023 +heading-start-left: true + +# MD024 +no-duplicate-heading: + siblings_only: true + +# MD026 +no-trailing-punctuation: + punctuation: '.,;:!。,;:!' + +# MD027 +no-multiple-space-blockquote: true + +# MD030 +list-marker-space: true + +# MD031 +blanks-around-fences: true + +# MD032 +blanks-around-lists: true + +# MD034 +no-bare-urls: true + +# MD037 +no-space-in-emphasis: true + +# MD038 +no-space-in-code: true + +# MD039 +no-space-in-links: true + +# MD042 +no-empty-links: true diff --git a/docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-comment-style.md b/docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-comment-style.md index 48509088a9689..9c8cd4c8f6096 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-comment-style.md +++ b/docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-comment-style.md @@ -20,7 +20,6 @@ - 如果代码并非最优,但你现在没有更好的方法 - 提醒自己或其他人代码中存在缺失的功能或即将开发的功能 - 以下部分也需要进行注释: - Package (Go) @@ -53,8 +52,6 @@ - 如果文本链接到同一个GitHub存储库中的文件,则使用 **relative URL** , - 如果带有此注释的代码是从另一个存储库复制来的,则使用 **absolute URL** , - - ### 语言 - 单词 diff --git a/docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-of-conduct.md b/docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-of-conduct.md index 746ae7cfe3fee..cbc5b8d5693b0 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-of-conduct.md +++ b/docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-of-conduct.md @@ -2,7 +2,6 @@ ## 共同的承诺 - 我们作为项目与社区的贡献者和维护者,承诺在参与项目以及社区的过程中,致力于彼此帮助、共同成长,维护开源开放、和谐友善的氛围,无论年龄、体型、种族、性别、性取向、表达、经验、教育、社会经济地位、国籍、个人外貌、国家、宗教。 ## 行为准则 @@ -29,22 +28,19 @@ 项目维护人员有权利也有责任删除、编辑或拒绝不符合上述行为准则的评论、提交、代码、wiki编辑和issue,并暂时或永久封禁发表不当言论或做出不当行为的贡献者。 - ## 适用范围 -本行为守则适用于所有项目空间,以及任何代表项目、社区的公开发言。比如:使用官方的项目电子邮件地址,通过官方社交媒体账户发布信息,或作为指定代表参加线上线下活动。具体条件由项目管理者进一步明确。 +本行为守则适用于所有项目空间,以及任何代表项目、社区的公开发言。比如:使用官方的项目电子邮件地址,通过官方社交媒体账户发布信息,或作为指定代表参加线上线下活动。具体条件由项目管理者进一步明确。 ## 具体实施 若您发现任何侮辱、骚扰或其他不合规定的行为都可以报告给项目团队:`hai.jin@matrixorigin.io`。我们将深入审核、调查所有的投诉并且做出及时、合理的反馈。此外,项目团队有义务保护举报人的隐私安全。 更加具体的执行政策将另行公布。 - - ## Attribution -本篇行为守则改编自[贡献者公约][homepage],version 1.4,也可参见 https://www.contributor-covenant.org/version/1/4/code-of-conduct.html。 +本篇行为守则改编自[贡献者公约][homepage],version 1.4,也可参见 。 [homepage]: https://www.contributor-covenant.org -相关问题的回答可参见:https://www.contributor-covenant.org/faq \ No newline at end of file +相关问题的回答可参见: \ No newline at end of file diff --git a/docs/cn/MatrixOne/Contribution-Guide/Code-Style/commit-pr-style.md b/docs/cn/MatrixOne/Contribution-Guide/Code-Style/commit-pr-style.md index fddf5748daee9..83d15633eada0 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/Code-Style/commit-pr-style.md +++ b/docs/cn/MatrixOne/Contribution-Guide/Code-Style/commit-pr-style.md @@ -16,7 +16,6 @@ 1. **What is your change? (必要)** - 它可能修复了一个特定的bug,添加了一个feature,提高了性能、可靠性或稳定性,或者只是保障安全性而进行的更改。 2. **Why this change was made? (必要)** @@ -49,6 +48,7 @@ - 如果该改动影响了三个及以上的模块,请使用`*`,如`*:`。 - 在冒号后的文本中使用小写字母。例如:"media: **update** the DM architecture image" - 不要在最后添加句号。 + - 第二行请留白 - 第三行“why”部分,如果没有特定的原因,您可以使用以下表述,如"Improve performance", "Improve test coverage." - 其他行不超过80个字符。 @@ -72,12 +72,10 @@ - 不要使用过长的复合词 - 非必要不缩写 - ## **Pull Request规范** 关于Pull Request中的描述,请参考下面的Pull Request模板,涵盖必要信息: - ``` **What type of PR is this?** diff --git a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-code.md b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-code.md index db6041c8fa8ea..23d26e845a306 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-code.md +++ b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-code.md @@ -1,12 +1,14 @@ # **代码贡献** + MatrixOne是一个由项目管理者、社区开发者共同维护、改进和扩展的开源项目。 本文档主要描述了开发的准则与一般流程,并提供了在编写代码、提交PR过程中需要使用的样式和模板。如果您在参与MatrixOne的贡献过程中遇到任何问题或发现一些错误,请在Github上提出[issue](https://github.com/matrixorigin/matrixone/issues) 或通其他平台联系我们。 ## **前置准备** -在正式开发之前,请确保您已经阅读了[准备工作](preparation.md), 已经对MatrixOne的核心理念、基础架构有一定了解,并准备好了开发所需要的相应环境、语言、工具等。 +在正式开发之前,请确保您已经阅读了[准备工作](preparation.md), 已经对MatrixOne的核心理念、基础架构有一定了解,并准备好了开发所需要的相应环境、语言、工具等。 ## **风格规范指南** + 在对MatrixOne进行开发和完善时,应该使代码、代码注释、提交信息(Committing Message)和拉取请求(Pull Request,简称PR)保持一致的风格。当您提交PR时,我们强烈建议您确保所作出的修改符合我们的一贯风格,这不仅会提高PR的通过率,并且也能使MatrixOne易于审查、维护和进一步开发。 * **代码规范** @@ -19,35 +21,47 @@ MatrixOne采用了Golang社区建议的编码规范,详情请见 [Effective Go 可参考[Commit&PR规范](../Code-Style/code-comment-style.md)。 ## **一般工作流程** + 您可以按照以下工作流程来进行开发并在Github上提交修改,如果您还需要更加详细的解释,可以查看[Make Your First Contribution](../make-your-first-contribution.md) **1.** 在Github上 Fork [matrixorigin/matrixone仓库](https://github.com/matrixorigin/matrixone). **2.** 将 Fork 的仓库克隆至本地: + ``` git clone git@github.com:/matrixone.git ``` + 并且把matrixone仓库添加为远程仓库: + ``` git remote add upstream https://github.com/matrixorigin/matrixone.git ``` + **3.** 创建一个新的分支,分支名自定义: + ``` git checkout -b topic-branch ``` + **4.** 在本地进行开发,完成相关修改,并完成必要的单元测试,最后进行提交。 **5.** 将修改推送至仓库的一个新分支: + ``` git push origin main:NEW_BRANCH ``` + **6.** 在仓库中的新分支`NEW_BRANCH`中创建 Pull Request,并添加相应标签、[建立与相关issue的关联](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)。 您 **7.** PR通过后,覆盖本地提交历史: + ``` git pull --force upstream main:main ``` + **8.** 更新您的仓库的`main` 分支: + ``` git push --force origin main:main ``` @@ -55,5 +69,5 @@ git push --force origin main:main 如果您仍然有一些困惑,可以参考 [GitHub官方文档](https://docs.github.com/en) 寻求帮助;若您发现我们提供的工作流程有错误或想要提出改善的方法,欢迎您[提出建议](https://github.com/matrixorigin/matrixone/issues/new/choose)! ## **代码审阅** -当您创建PR请求时,您可以指定一些审阅者,或者留空。并且您可以添加一些相关的标签,这样更容易识别PR的类型、优先级等。在代码审阅期间,审阅者会对您的代码片段给出意见,您可以相应地在本地修改您的分支上的代码,提交更改,然后推送到GitHub,新的提交会自动附加到PR上。 +当您创建PR请求时,您可以指定一些审阅者,或者留空。并且您可以添加一些相关的标签,这样更容易识别PR的类型、优先级等。在代码审阅期间,审阅者会对您的代码片段给出意见,您可以相应地在本地修改您的分支上的代码,提交更改,然后推送到GitHub,新的提交会自动附加到PR上。 diff --git a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-documentation.md b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-documentation.md index 8fa57e8d7662a..a2e97b23eb567 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-documentation.md +++ b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-documentation.md @@ -6,9 +6,8 @@ 开始之前请尽量熟悉基本的[Markdown](https://www.markdownguide.org/basic-syntax/)语法并阅读[行为守则](../Code-Style/code-of-conduct.md)和[谷歌开发者文档风格指南](https://developers.google.com/style/),以便您写出更高质量的文档。 - - ## **文档管理逻辑** + MatrixOne文档通过三个仓库来协调管理: * [matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io)仓库包含文档框架(配置文件)和CI设置 @@ -18,13 +17,16 @@ MatrixOne文档通过三个仓库来协调管理: * [artwork](https://github.com/matrixorigin/artwork) 仓库包含了文档所用到的图像等非结构性文件 `matrixorigin.io`仓库中有一个子模块`submodule`,其引用了`matrixone`仓库中的文档内容,当`matrixone`仓库的内容更新时,`submodule`也会同步更新;而图像等非结构化文件则直接引用`artwork`仓库的网站链接,如: + ``` https://github.com/matrixorigin/artwork/blob/main/docs/overview/overall-architecture.png?raw=true ``` + `matrixorigin.io`部署了一个CI程序,当有新的代码被合并时将自动触发,将文档发布到我们的[官方文档网站](https://docs.matrixorigin.io/)。 我们的文档是基于 [mkdocs-material](https://github.com/squidfunk/mkdocs-material)组件进行开发的,您可以在此链接中了解更多信息。 ## **文档内容架构** + MatrixOne文档内容可以分为如下几个模块: * **Overview**: MatrixOne的简介,包含了项目特点、架构、设计思路和技术细节。 @@ -46,6 +48,7 @@ MatrixOne文档内容可以分为如下几个模块: 如果您发现了错别字或语法错误,可以点击本页面的`Edit this Page`按键直接进行修改。 ## **一般工作流程** + 当您需要更改文档的具体内容但不涉及章节顺序、架构组织的调整时,只需要对`matrixone`进行操作;反之,若您需要调整文档框架,改动`mkdocs.yml`文件时,则需要对`matrixorigin.io`库进行修改。 以下流程演示的是对二者均做修改的情况,实际情况可以根据您的需求进行简化。 @@ -54,24 +57,31 @@ MatrixOne文档内容可以分为如下几个模块: **2.** Fork [matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io) 和 [matrixone](https://github.com/matrixorigin/matrixone) 仓库. **3.** 克隆[matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io)仓库,使用`--repository`来引用`matrixone`中的内容。 + ``` $ git clone --recursive git@github.com:yourusername/matrixorigin.io.git ``` + 克隆[matrixone](https://github.com/matrixorigin/matrixorigin.io)仓库。 + ``` $ git clone git@github.com:yourusername/matrixone.git ``` **4.** 在您的本地matrixone文件夹中将`matrixone`仓库添加为远程仓库。 + ``` git remote add upstream https://github.com/matrixorigin/matrixone.git ``` + 在您的本地matrixorigin.io文件夹中将`matrixorigin.io`仓库添加为远程仓库。 + ``` git remote add upstream https://github.com/matrixorigin/matrixorigin.io.git ``` **5.** 本地的matrixorigin.io文件夹中将包含文档所需要的全部文件,因此您可以运行 `mkdocs serve` 命令, 然后在`http://localhost:8000`网址中预览文档,检查整个项目文件是否可以正常运行,并且后续也可以检查您所做的修改是否正确。 + ``` $ mkdocs serve ``` @@ -81,6 +91,7 @@ $ mkdocs serve **7.** 确认修改无误后,使用`git add`和`git commit`命令在本地提交修改,并推送至您Fork的远程仓库`matrixorigin.io` 与 `matrixone` 。 我们建议您推送至远程仓库的新分支: + ``` git push origin main:NEW_BRANCH ``` @@ -92,10 +103,13 @@ git push origin main:NEW_BRANCH **10.** 最后,还有一些操作可以帮助保持MatrixOne远端仓库,您的远端仓库和本地仓库均保持一致。 覆盖本地提交历史: + ``` git pull --force upstream main:main ``` + 更新Github上的`main`分支: + ``` git push --force origin main:main ``` @@ -103,7 +117,6 @@ git push --force origin main:main !!! info 注意 若您在两个仓库都做了修改,那么以上大部分操作都需要分别针对两个仓库都执行一遍。 - ## **写一篇博文** 如果您有意写一篇关于MatrixOne的博文,请在GitHub上提出[issue](https://github.com/matrixorigin/matrixone/issues/new/choose) ,或者将您的想法发送到[dengnan@matrixorigin.io](mailto:dengnan@matrixorigin.io),无论是简单的idea还是完整的草案,我们统统接受。我们会尽快审查所有内容,如果您的文章或想法很契合我们的博客,我们会直接联系您。 diff --git a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/make-a-design.md b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/make-a-design.md index df82edb11d325..f035e90093f59 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/make-a-design.md +++ b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/make-a-design.md @@ -1,4 +1,5 @@ # **提交设计方案** + 前面章节提到了很多种类的修改,比如bug修复、文档完善,这些都可以通过GitHub的PR工作流程来实现;但与此不同的是,如果您想要在MatrixOne中实现新的功能或增添新的组件,都不仅仅是一个idea这么简单,我们鼓励您提出想法的同时还制定相应的设计方案,将其表达为技术设计文档。 因此,本节的目的正是引导您撰写一份技术设计文档,以期可以为这个新功能提供一个更加权威的、大众化的解释,各方人员可以更深入地了解这个模块的核心理念与发展方向。 @@ -8,8 +9,8 @@ 我们鼓励您向有经验的开发人员寻求帮助,通过他们的建议您可以修正设计架构并完善技术细节。 您可以在前往Github,提交一个`Feature Request` 或 `Refactoring Request`来向大家展示您的想法。 - ## **一般流程** + 通常,从头到尾地完成一项技术设计需要以下步骤: * 在GitHub上提出issue,描述该功能想要解决的问题、目标、大致解决方案。 diff --git a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md index 9e78ea61b54fe..a31da54792716 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md +++ b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md @@ -1,28 +1,34 @@ # **准备工作** + 非常欢迎您参与到MatrixOne(以下简称MO)项目的建设中来!无论你是初识MatrixOne,还是已经迫切地想参与到开发工作中来,亦或是在阅读文档、使用产品的过程中发现了一些问题,都欢迎你提出意见和建议,与我们共同打造更加强大、稳定的MatrixOne! 当然,在您向MatrixOne项目提出改进之前,我们需要提前说明一些基本规范与流程,以提高整个贡献过程的质量与流畅性,同时也能保障MO的稳定性与安全性。 此外,在本章中,我们为尚未熟知MO的贡献者们提供一些了解我们的渠道,希望能为你们带来一些便利! ## **了解MatrixOne** + ### 特点与框架 + 在[MatrixOne简介](./../Overview/matrixone-introduction.md)中您可以了解到MO的超融合、云边协同特性以及其所创造的优异表现与独特价值。 此外,在[MatrixOne框架](./../Overview/matrixone-architecture.md)中您可以详细地了解MO的整体架构,以及存储层、计算层、负责分布式管理的MatrixCube的具体组成情况。 同时,你也可以查阅[MatrixOne术语表](../../Glossary/glossary.md)来了解一些复杂的词汇。 在技术层面,[SQL参考指南](./../Reference/SQL-Reference/Data-Definition-Statements/create-database.md) 为您提供了详细的SQL语言的参考,其中对语法和示例都有详细解释;同样,[自定义函数](./../Reference/Customer-Functions/year.md)提供了MO中自定义函数的相关解释。 ### 建设情况 + 目前,MatrixOne v0.3.0 已经发布了,您可以通过[版本发布指南](./Release-Notes/v0.3.0.md)来了解最新的发布信息,其中包含了最新的修改与优化。 同时,我们当前正在开发 v0.4.0和 v0.5.0版本,对应的工作任务在GitHub的milestone[0.4.0](https://github.com/matrixorigin/matrixone/milestone/5)中列出。 关于长期的项目规划,请参阅[MatrixOne roadmap](https://github.com/matrixorigin/matrixone/issues/613)。 ## **你可以做些什么?** + 对MatrixOne的贡献可分为以下几类: + * 报告代码中的bug或文档中的谬误。请在GitHub上提出[issue](https://github.com/matrixorigin/matrixone/issues/new/choose),并提供问题的详细信息。请记得选取合适的[issue模板](./Report-Issues.md#issue-templates),并打上标签。 * 提议新的功能。请在[Feature Request](https://github.com/matrixorigin/matrixone/issues/new/choose)中描述详情并与社区中的开发人员商议。一旦我们的团队认可了您的计划,您就可以按照[工作流程](Contribute-Code.md#workflow)进行具体开发。 * 实现某个功能或修复既有问题,请按照[工作流程](Contribute-Code.md#workflow)完成开发。如果你需要关于某一特定问题的更多背景信息,请就该问题发表评论。 - ## **工作目录与文件介绍** + 我们将为Github上matrixorigin/matrixone的项目目录及其中关键文件进行简单介绍,以期为您的深入了解和开发提供指导性帮助。 [matrixone](https://github.com/matrixorigin/matrixone)是MatrixOne代码所在的主库,我们将介绍其中的项目目录以及关键文件,以期为您的深入了解和开发提供指导性帮助。 @@ -48,10 +54,6 @@ | **vm/engine/tpe** | TPE引擎(事务处理引擎) | | **buildin/** | 系统的内置函数 | - - - - 在文档方面,[matrixone](https://github.com/matrixorigin/matrixone), [matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io) 与 [artwork](https://github.com/matrixorigin/artwork)都是在贡献过程中可能使用的库,详情参见[文档贡献](contribute-documentation.md)。 | 目录 | 内容 | @@ -61,17 +63,18 @@ | **matrixorigin.io/mkdocs.yml** | 文档网站的配置文件 | | **artwork/docs** | 文档官网出现的图片和图表| - - - ## **开发环境** + MO主要由Go语言编写,因此需要提前安装部署好相关的开发环境,简要的示例流程如下: + 1. 安装版本为1.18的Go,您可以通过[Download Go](https://go.dev/dl/)与[Installation instructions](https://go.dev/doc/install)教程来完成整个过程。 2. 定义环境变量并修改路径,您可以遵循以下示例流程: + ```sh export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin ``` + !!! Note 提示 MatrixOne使用[`Go Modules`](https://github.com/golang/go/wiki/Modules) 来管理相关依赖。 @@ -80,6 +83,7 @@ export PATH=$PATH:$GOPATH/bin 此外,确保您至少已经安装了单机版本的MatrixOne,具体过程可参照 [Install Standalone MatrixOne](./../Get-Started/install-standalone-matrixone.md)。 ## **Github & Git** + 为更好地开发建设MatrixOne,我们采取了开源运营的方式,通过Github为项目维护人员和其他开发者提供了一个协作平台。因此,如果您想参与到MO的开发中来,我们强烈建议您采取Github的渠道。 若您还未使用过Github或缺少相关开发经验,您首先需要熟悉**GitHub**上的相关操作,并学习基本的**git**命令。 如果您没有Github帐户,请在[https://github.com](https://github.com)上完成注册。 @@ -89,5 +93,6 @@ export PATH=$PATH:$GOPATH/bin 此外,我们建议您学习并使用**git**命令来完成github上的各种流程,因为我们提供的相关工作流程大多通过**git**命令完成,这有助于您提高效率。 您可通过[install git](http://git-scm.com/downloads)安装git环境。 并且可以通过以下教程来学习如何使用: + * [简易版](https://education.github.com/git-cheat-sheet-education.pdf) * [详细版](https://git-scm.com/book/en/v2) \ No newline at end of file diff --git a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/report-an-issue.md b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/report-an-issue.md index 08859eb6e5802..706ec158ea75d 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/report-an-issue.md +++ b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/report-an-issue.md @@ -1,13 +1,14 @@ # **提出问题** + 您在使用或开发MatrixOne过程中遇见的任何问题都能以[issues](https://github.com/matrixorigin/matrixone/issues/new/choose)的形式提出来,我们也鼓励您按照我们设定的模板和标签对issues进行详细描述和分类,以便更高效地解决问题。 本节旨在介绍提出问题时需要遵循的模板、标签和注意事项。 - ## **避免重复问题** 在提出issue之前,尽量先确认其他人是否已经提出过相同或类似的问题,避免重复,您可以使用[search bar 工具](https://docs.github.com/en/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests)帮助您筛选查找。 ## **模板** + 针对不同种类的问题,MatrixOne使用了不同的模板对其内容进行刻画,其中大多描述了问题的关键信息,有助于审查者与其他开发者理解并参与其中。 例如,`bug report`问题模板包含以下信息: @@ -19,7 +20,6 @@ * **Expected & Actual Behavior** Describe what's the observed and your expected behavior respectively. - `Enhancement` 问题模板包含以下信息: * **What would you like to be added** @@ -70,8 +70,6 @@ A clear and concise description of any alternative solutions or refactoring meth * **Additional context** Add any other context or screenshots about the refactoring request here. - - ## **标签** 除了描述问题的详细信息外,您还可以根据问题所属的组件以及问题所属版本为其添加适当的标签。当您的issue提交之后,会自动打上`needs-triage`的标签,之后项目维护者会详细阅读您的issue,然后为之打上合适的标签并分配给合适的开发者。 @@ -81,4 +79,3 @@ Add any other context or screenshots about the refactoring request here. 当您首次参与贡献时,您可以选择[`good-first-issue`](https://github.com/matrixorigin/matrixone/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)标签下的问题着手解决,其下的每个问题都是相对来说容易解决的。 详情请阅读[快速上手](../make-your-first-contribution.md)章节。 - diff --git a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/review-a-pull-request.md b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/review-a-pull-request.md index 692edf17ef2d0..90523db29354e 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/review-a-pull-request.md +++ b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/review-a-pull-request.md @@ -1,9 +1,11 @@ # **审阅与评论** + 对MatrixOne来说,对PR的审阅和评论是至关重要的:您可以对他人的PR进行分类,以便有专家更快的来解决这些问题;您也可以对代码的内容进行审阅,对代码编写的风格、规范等提出建议;哪怕是在评论区留下一个小小的idea,这也弥足珍贵。 所有别再犹豫,别再担心您的想法不够完善,无论多么微小的建议都可能会对MatrixOne产生深远影响。 当然,在此之前,我们希望您能认真阅读本节,了解基本要求和相关方法。 ## **基本原则** + 当对一个PR进行评论或者审阅时,无论内容如何,我们呼吁所有参与者都保持友好和善的态度,营造一个和谐的社区氛围。 * **尊重他人** @@ -16,6 +18,7 @@ 不要吝啬对他人的赞美!一个好的想法或者好的成果值得我们夸赞。在很多情况下,鼓励、赞美他人往往比不留情面的批评更有价值! 此外,在具体内容上我们有如下建议: + * **详细而具体** 我们希望您能在评论中提供更为详细而具体的信息,因为信息越详细,他人就更容易理解,也可以更高效地解决问题。如果您进行了测试,完全可以放上测试环境和结果;如果您提出了一些建议,那不妨说说应该如何落实。 @@ -27,9 +30,11 @@ 当遇见一些复杂问题时,即使是在综合考量多方因素之后也很难抉择,“接受”还是“拒绝”,是个两难的问题———我们也无法给出一个明确、具体的标准,只能说“具体情况,具体分析”。但是我们建议您在难以抉择时,寻求他人的帮助。 ## **对PR分类** + 有些PR创建者可能并不熟悉MatrixOne或相关开发工作流程,因此不确定应该添加何种标签,也不了解应该把问题分配给谁。如果您知道该如何做,我们希望您可以向他们施以援手,为问题补充上标签等信息,这有助于推动问题的解决进程。 ## **检查正误** + 当您检查代码或其他修改的正误时,务必注意以下几点: * **聚焦** @@ -44,4 +49,3 @@ 如果一个PR改变了用户构建、测试、交互或发布代码的方式,您必须检查它是否也更新了相关文档,如`README.md`。类似地,如果一个PR删除或弃用了一段代码,您必须检查相应的文档是否也应该被删除。 * **性能** 如果您发现新增的代码可能会影响MatrixOne的性能,您可以要求开发者提供一个基准测试(如文档中展示的SSB、NYC测试)。 - diff --git a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/types-of-contributions.md b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/types-of-contributions.md index 699d78ff438a7..e94c251960a34 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/types-of-contributions.md +++ b/docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/types-of-contributions.md @@ -14,7 +14,7 @@ | 类型 | 说明 | | --------------------------------------------- | ------------------------------------------------------------ | -| 报告或修复技术文档的问题| 您可以点击文档网站上的 *edit the page* 按键,可以直接在当前页面进行修改并[提交PR](https://github.com/matrixorigin/matrixone/pulls)。当然您可以可以在GitHub的[issue]中提出问题,并描述相关信息(https://github.com/matrixorigin/matrixone/issues/new/choose)。| +| 报告或修复技术文档的问题| 您可以点击文档网站上的 *edit the page* 按键,可以直接在当前页面进行修改并[提交PR](https://github.com/matrixorigin/matrixone/pulls)。当然您可以可以在GitHub的[issue]中提出问题,并描述相关信息()。| | 提交一份新的文档 | 在撰写一份完整的文档之前,请阅读[文档贡献指南](contribute-documentation.md). | ## 其他 diff --git a/docs/cn/MatrixOne/Contribution-Guide/make-your-first-contribution.md b/docs/cn/MatrixOne/Contribution-Guide/make-your-first-contribution.md index 80110f5061990..de1e8b80bbc72 100644 --- a/docs/cn/MatrixOne/Contribution-Guide/make-your-first-contribution.md +++ b/docs/cn/MatrixOne/Contribution-Guide/make-your-first-contribution.md @@ -1,82 +1,107 @@ # **快速贡献** + MatrixOne社区欢迎所有开发者的加入和贡献!本章节旨在帮助您快速完成首次贡献。 ## **如何贡献?** + 在哪些方面可以大展拳脚呢?详情请参见[贡献种类](How-to-Contribute/types-of-contributions.md)。 如果您是完全的新手,您可以从以下两种类别中选择一种进行尝试,这些类别的问题对您技术背景的要求很少,所以不必担心! * 报告代码中出现的bug * 完善MatrixiOne文档 - 在开始处理问题之前,建议您先将找到的问题作为GitHub上的一项issue提出。此外,我们准备了一系列带有`good-first-issue`标签的issue,它们包含了明晰的实现步骤和预期结果,您可以此作为突破口! - ## **认领任务** -当您提出issue之后或者是在浏览`good-first-issue`后决定上手解决,您需要认领这次issue。在相应issue的评论中输入如“I'd like to work on this issue”,社区人员会将任务分配给您,此时,您可以在右侧的Assignees板块看见自己,接下来便可以正式着手解决问题。 +当您提出issue之后或者是在浏览`good-first-issue`后决定上手解决,您需要认领这次issue。在相应issue的评论中输入如“I'd like to work on this issue”,社区人员会将任务分配给您,此时,您可以在右侧的Assignees板块看见自己,接下来便可以正式着手解决问题。 ## **前置准备** + 请确保您至少安装了单机版MatrixOne并部署了相关开发环境。具体请参考[准备工作](How-to-Contribute/preparation.md)。 ## **工作流程** + ### **步骤 1: Fork 项目仓库** + 首先前往Github上的[matrixorigin/matrixone](https://github.com/matrixorigin/matrixone)仓库. 在页面右上角处,点击 `Fork` 按键,创建主库的分叉,并作为您之后主要工作的仓库。 ![Fork our repo](https://github.com/matrixorigin/artwork/blob/main/docs/contribution-guide/contribution-guide-fork.png?raw=true) ### **步骤 2: 将仓库克隆至本地** + 前往刚才您创建的Fork仓库,点击 `Code` 按键,然后再点击“复制”图标,将库的网址复制到剪贴板。 ![Clone your fork](https://github.com/matrixorigin/artwork/blob/main/docs/contribution-guide/contribution-guide-clone.png?raw=true) 然后,在您本地挑选一个合适的工作目录,打开命令行输入以下 Git 命令将文件克隆至您本地的目录: + ``` git clone ``` + 例如: + ``` git clone git@github.com:/matrixone.git ``` + `` 是您的Github账号名,换言之,您要用您自己的账号名替换它。 ### **步骤 3: 添加 matrixone 仓库作为本地的远程仓库** + 您可以将matrixorigin/matrixone 添加为本地的远程仓库,以便后续步骤进行操作: + ``` git remote add upstream https://github.com/matrixorigin/matrixone.git ``` + 其中,`upstream` 是该远程仓库的名字,您可以自行替换,但注意后续对该词也应该一并替换。 ### **步骤 4: 修改、开发** + #### **修改** + 克隆代码库之后您就可以开始您的开发过程,可以在您所需要的地方进行任何修改。 #### **试运行** + 如果您在修改完成后想知道改动是否有效,能否解决最初的问题,或者是否影响程序运行,您可以运行MatrixOne进行简单的预览和测试。 当然,请确保您已经按照教程完成了[安装和部署](./../Get-Started/install-standalone-matrixone.md),并能成功连接到[MatrixOne服务器](./../Get-Started/connect-to-matrixone-server.md)。 ### **步骤 5: 提交修改** + 当完成以上修改和测试后,您就可以开始提交修改。首先使用将您所更改的文件添加至 git 所管理的目录中: + ``` git add ``` + `` 是您所修改的文件的名称。 您也可以使用如下命令,直接将当前文件夹中的所有文件都添加至管理目录: + ``` git add . ``` + 之后,您可以提交您的修改 + ``` git commit -m "" -s ``` + ``是您对本次修改的简单总结和描述,试着做到简明扼要。 ### **步骤 6: 代码推送** + 提交修改后,您需要将本地的提交推送至远程仓库———我们强烈推荐您推送至目标仓库的一个新分支: + ``` git push origin main:NEW_BRANCH ``` + `NEW_BRANCH` 您创建并推送至的新分支名,您也可以随意替换它,但也记得后续一并修改。 ### **步骤 7 创建PR** + 推送后,可以在您所Fork的仓库中看到相关提示信息,点击 **Compare & Pull Request** 按键来创建一个PR(该PR应该是从个人仓库的`NEW_BRANCH` 分支到主库的`main`分支。 !!! Note 注意 建议按照PR中所给出的模板要求,撰写相关信息,如此可以准确表达您的问题以及所做的修改,从而提高审查效率。 @@ -87,13 +112,17 @@ git push origin main:NEW_BRANCH 您的PR一旦创建,就有社区资深的开发人员审核您的代码,他将会检查您做的修改并且进行回复,请及时与您沟通,然后按照要求进行修改。 ### **步骤 8 同步代码库** + 当进行到这一步时,恭喜您的修改已经被接受并且merge进入项目中,感谢您做出的贡献! 但工作还没有结束,还有一些工作要做(这些工作有助于保证提交记录的干净,有利于项目进一步发展)。 可以将远端仓库的代码拉取下来覆盖本地,以保持同步: + ``` git pull --force upstream main:main ``` + 最后,再将代码推送到您的仓库中的`main`分支,这样就能保证三个仓库代码均一致。 + ``` git push --force origin main:main ``` diff --git a/docs/cn/MatrixOne/Develop/design-a-database.md b/docs/cn/MatrixOne/Develop/design-a-database.md index 9c1d3c028ba83..46f3dccfaca0f 100644 --- a/docs/cn/MatrixOne/Develop/design-a-database.md +++ b/docs/cn/MatrixOne/Develop/design-a-database.md @@ -1,2 +1 @@ # Design A Database - diff --git a/docs/cn/MatrixOne/FAQs/general-faqs.md b/docs/cn/MatrixOne/FAQs/general-faqs.md index 0dc73b683ee33..da39dbfc00462 100644 --- a/docs/cn/MatrixOne/FAQs/general-faqs.md +++ b/docs/cn/MatrixOne/FAQs/general-faqs.md @@ -45,7 +45,6 @@ MatrixOne是一个完全在Github上进行的开源项目,欢迎所有开发者的贡献。可以参考我们的[贡献指南](../Contribution-Guide/make-your-first-contribution.md)
- ## **部署常见问题** * **MatrixOne对部署硬件的配置要求如何?** diff --git a/docs/cn/MatrixOne/Get-Started/Playground.md b/docs/cn/MatrixOne/Get-Started/Playground.md index 32f48912360e4..6c28b7a3f7d5d 100644 --- a/docs/cn/MatrixOne/Get-Started/Playground.md +++ b/docs/cn/MatrixOne/Get-Started/Playground.md @@ -1,18 +1,19 @@ # **Playground** + [MatrixOne Playground](https://playground.matrixorigin.io/?tutorial=SSB-test-with-matrixone&step=1)提供了一个交互式工作台,可以让您直接通过浏览器来运行MatrixOne的SQL语句等功能,快速体验MatrixOne的最新能力。 - * 你可以参考[SQL参考指南](../Reference/SQL-Reference/Data-Definition-Statements/create-database.md)来熟悉相关SQL语句 * 你可以查看[实践教程](Tutorial/SSB-test-with-matrixone.md)来学习如何使用MatrixOne来进行SSB、NYC测试等最佳实践。 ## **限制** + MatixOrigin Playground只能在**只读**模式下进行操作,因此相关DDL命令和部分改变数据的DML命令不可用,具体限制如下: * **DDL** 命令不可用: ```create/drop table``` , ```truncate``` , ```update``` , ```set``` ,```use``` * 以下展示的**DML** 命令不可用: -```insert``` , ```replace``` , ```delete```,```select into ``` +```insert``` , ```replace``` , ```delete```,```select into``` * ```commit``` 不可用 @@ -42,18 +43,18 @@ SHOW TABLES; 查询结构显示于右下侧 点击**Continue**按键来进行下一步 - - ### **运行查询语句** 现在,您可以使用我们提供的SQL命令来查询数据。 例如: + * **运行 Q1.1** ``` select sum(lo_revenue) as revenue from lineorder join dates on lo_orderdate = d_datekey; ``` + 此外,你可以在查询中使用`join`连接: * **运行 Q1.2** @@ -65,6 +66,7 @@ join dates on lo_orderdate = d_datekey; ``` 也可以使用```group by``` 与```order by``` 命令: + * **运行 Q2.1** ``` @@ -79,8 +81,8 @@ order by d_year, p_brand; **Playground**提供了更多查询命令,您可以自行测试。 - ## **相关信息** + 本页面介绍了Playground的特性、限制和示例。有关使用MatrixOne时所需的其他更多信息,可参阅以下内容: * [安装单机版MatrixOne](install-standalone-matrixone.md) diff --git a/docs/cn/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md b/docs/cn/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md index 27d2e97231a82..37933e7f1e0b8 100644 --- a/docs/cn/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md +++ b/docs/cn/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md @@ -4,6 +4,7 @@ 通过本教程,您将了解如何使用MatrixOne来完成对NYC Taxi数据集的查询。 该数据集的详细信息以及下载教程可参见: + * [https://github.com/toddwschneider/nyc-taxi-data](https://github.com/toddwschneider/nyc-taxi-data) * [http://tech.marksblogg.com/billion-nyc-taxi-rides-redshift.html](http://tech.marksblogg.com/billion-nyc-taxi-rides-redshift.html). @@ -12,8 +13,8 @@ 确保你已经安装了[单机版MatrixOne](../install-standalone-matrixone.md)并[连接到MatrixOne服务](../connect-to-matrixone-server.md). - ## **1. 下载并导入数据** + 本节教程参考[https://github.com/toddwschneider/nyc-taxi-data](https://github.com/toddwschneider/nyc-taxi-data),您可以从此处了解关于数据集下载和导入的详细信息。 该数据集共有17亿行数据,占用450 GB的空间,请确保有足够的空间来存放数据。 @@ -26,6 +27,7 @@ ``` ./download_raw_data.sh && ./remove_bad_rows.sh ``` + `remove_bad_rows.sh`脚本修复了两个特定的文件,其中数据极少但是列字段很多。 * **初始化数据库** @@ -50,7 +52,6 @@ FiveThirtyEight Uber数据集包含了2014年4月至9月的Uber出行记录。Ub ./import_2014_uber_trip_data.sh ``` - ## **2. 从PostgreSQL导出数据** ``` @@ -124,8 +125,8 @@ COPY ) TO '/matrixone/export_data/trips.tsv'; ``` - ## **3. 在MatrixOne中建表** + ``` CREATE TABLE trips ( diff --git a/docs/cn/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md b/docs/cn/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md index 5371c20da6127..49e2d51f47771 100644 --- a/docs/cn/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md +++ b/docs/cn/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md @@ -6,7 +6,6 @@ SSB星型模式基准测试是OLAP数据库性能测试的常用场景,通过 确保你已经安装了[单机版MatrixOne](../install-standalone-matrixone.md)并[连接到MatrixOne服务](../connect-to-matrixone-server.md). - ## **1. 编译dbgen** ``` @@ -27,8 +26,8 @@ $ ./dbgen -s 1 -T s $ ./dbgen -s 1 -T d ``` - ## **3. 在MatrixOne中建表** + ``` create database if not exists ssb; use ssb; @@ -154,7 +153,9 @@ CREATE TABLE lineorder_flat( ``` ## **4. 导入数据** + 将`system_vars_config.toml`参数增大,例如10GB,然后重新启动MatrixOne服务。 + ``` max-entry-bytes = "10GB" ``` @@ -187,6 +188,7 @@ load data infile '/ssb-dbgen-path/lineorder_flat.tbl ' into table lineorder_flat ## **5. 运行SSB测试命令** ### **单表查询** + ```sql --Q1.1 SELECT sum(LO_EXTENDEDPRICE * LO_DISCOUNT) AS revenue FROM lineorder_flat WHERE year(LO_ORDERDATE)=1993 AND LO_DISCOUNT BETWEEN 1 AND 3 AND LO_QUANTITY < 25; diff --git a/docs/cn/MatrixOne/Get-Started/connect-to-matrixone-server.md b/docs/cn/MatrixOne/Get-Started/connect-to-matrixone-server.md index 2392e97d1e538..669a42c4ab80a 100644 --- a/docs/cn/MatrixOne/Get-Started/connect-to-matrixone-server.md +++ b/docs/cn/MatrixOne/Get-Started/connect-to-matrixone-server.md @@ -8,10 +8,8 @@ [部署分布式MatrixOne集群](install-distributed-matrixone.md) - ## **1. 安装MySQL客户端** - MatrixOne支持MySQL连接协议,因此您可以使用各种语言通过MySQL客户机程序进行连接。 目前,MatrixOne只兼容Oracle MySQL客户端,因此一些特性可能无法在MariaDB、Percona客户端下正常工作。 @@ -19,9 +17,11 @@ MatrixOne支持MySQL连接协议,因此您可以使用各种语言通过MySQL ## **2. 连接MatrixOne服务** 你可以使用MySQL命令行客户端来连接MatrixOne服务。 + ``` $ mysql -h IP -P PORT -uUsername -p ``` + 连接符的格式与MySQL格式相同,您需要提供用户名和密码。 此处以内置帐号作为示例: @@ -33,4 +33,5 @@ $ mysql -h IP -P PORT -uUsername -p $ mysql -h 127.0.0.1 -P 6001 -udump -p Enter password: ``` + 目前,MatrixOne只支持TCP监听。 diff --git a/docs/cn/MatrixOne/Get-Started/install-distributed-matrixone.md b/docs/cn/MatrixOne/Get-Started/install-distributed-matrixone.md index 5bafb9a2fa52a..2e1f0eb16cc64 100644 --- a/docs/cn/MatrixOne/Get-Started/install-distributed-matrixone.md +++ b/docs/cn/MatrixOne/Get-Started/install-distributed-matrixone.md @@ -1,9 +1,9 @@ # **部署分布式MatrixOne集群** - MatrixOne支持分布式部署,需要至少三个节点来完成分布式配置。 ## **软硬件环境要求** + 服务器建议配置:x86 CPU,16核,64GB内存。 操作系统版本要求:CentOS 7.x版本。 @@ -14,24 +14,25 @@ MatrixOne集群中有两种类型的节点(store):调度节点(prophet stores) 例如,如果集群中有三个节点,那么所有节点都是调度节点。 如果集群中有5个节点,那么其中3个是调度节点,2个是纯存储节点。 - ## **部署流程** + 此处使用五个节点来演示部署教程。 -### **步骤1** +### **步骤1** 准备3台服务器作为调度节点。 每个节点必须安装单机版本的MatrixOne。安装步骤与[单机版安装教程](install-standalone-matrixone.zh.md)一致。 - ### **步骤2** 创建store1,称之为`Prophet Genesis Store`(种子调度节点) **1.** 设置种子调度节点的`id` + ``` nodeID = 1 ``` + **2.** 设置`addr-raft` 与 `addr-client`参数,分别用于接收集群中的Raft组与`Shard Proxy`的信息: ``` @@ -40,11 +41,13 @@ addr-client = "your_ip_address:20000" ``` **3.** 设置`Shard`的容量限制,超过这个容量`Shard`将会自动分裂: + ``` shard-capacity-bytes = "4096MB" ``` **4.** 设置`rpc-addr`来接收集群中的心跳信息: + ``` rpc-addr = "your_ip_address:30000" ``` @@ -56,16 +59,21 @@ join = "" client-urls = "your_ip_address:40000" peer-urls = "your_ip_address:50000" ``` + **6.** 将`storage-node`设置为`TRUE`,调度节点将存储集群的元数据信息: + ``` storage-node = true ``` + **7.** 设置`max-replicas`参数来指定每个`Shard`需要多少个副本。注意该参数取值只能是`2*N+1`: + ``` max-replicas = 3 ``` ### **步骤3** + 将store2与store3设置为调度节点,并重复步骤1与步骤2。唯一的区别在于需要设置独特的`nodeID`与`join`地址: ``` @@ -74,11 +82,13 @@ join = "ip_address_of_store1" ``` ### **步骤4** + 设置其他两个节点为纯存储节点(pure storage store),并重复步骤1与步骤2。有三个额外的参数需要指定: * Set a unique number for nodeID. 按照nodeID设置相应的number * 将`storage-node`设置为TRUE` * 使用三个调度节点的三个`client-urls`参数来当作`external-etcd`参数: + ``` nodeID = 4/5; storage-node = false; @@ -86,4 +96,5 @@ storage-node = ["ip_address_of_prophet_store1","ip_address_of_prophet_store2","i ``` ## **相关信息** + 本节介绍了分布式MatrixOne集群的安装部署流程。若想了解更多关于分布式架构配置参数的信息,可以查阅[分布式配置参数手册](../Reference/System-Parameters/distributed-settings.md). diff --git a/docs/cn/MatrixOne/Get-Started/install-standalone-matrixone.md b/docs/cn/MatrixOne/Get-Started/install-standalone-matrixone.md index 3f8ee1cb4d3f1..fcda638654d6a 100644 --- a/docs/cn/MatrixOne/Get-Started/install-standalone-matrixone.md +++ b/docs/cn/MatrixOne/Get-Started/install-standalone-matrixone.md @@ -26,6 +26,7 @@ $ cd matrixone ``` #### 3. 运行编译文件 + 你可以运行`make debug`与`make clean`或者其他任何`Makefile`支持的命令。 ``` @@ -38,23 +39,29 @@ $ make build ``` $ ./mo-server system_vars_config.toml ``` + ## **下载二进制包** + 从0.3.0版本开始,您可以直接下载二进制包,然后在X86_64 Linux环境或者X86_64的MacOS环境中运行MatrixOne。 + #### 1. 下载二进制包并解压 Linux环境 + ```bash $ wget https://github.com/matrixorigin/matrixone/releases/download/v0.4.0/mo-server-v0.4.0-linux-amd64.zip $ unzip mo-server-v0.4.0-linux-amd64.zip ``` MacOS环境 + ```bash $ https://github.com/matrixorigin/matrixone/releases/download/v0.4.0/mo-server-v0.4.0-darwin-x86_64.zip $ unzip mo-server-v0.4.0-darwin-x86_64.zip ``` #### 2. 启动MatrixOne服务 + ``` $./mo-server system_vars_config.toml ``` @@ -64,12 +71,15 @@ $./mo-server system_vars_config.toml #### 1. 安装docker 请检查Docker daemon是否正在后台运行,并确认docker版本: + ``` $ docker --version ``` + #### 2. 创建并运行容器 使用以下命令将从Docker Hub中拉取最近的MatrixOne镜像: + ``` $ docker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:latest ``` diff --git a/docs/cn/MatrixOne/MatrixCampEvent.md b/docs/cn/MatrixOne/MatrixCampEvent.md index 96445a816f6f6..f00755dfdd537 100644 --- a/docs/cn/MatrixOne/MatrixCampEvent.md +++ b/docs/cn/MatrixOne/MatrixCampEvent.md @@ -9,107 +9,105 @@ MatrixOne社区一共准备了4个类别的56个任务,有不同的难度级 这次的任务大家将要挑战的是MatrixOne的系统函数和聚合函数,对于刚入门数据库的同学来讲是相对基础但是又不乏挑战的任务。 - - 基础任务-系统函数(Built-in function): 所谓的系统函数就是数据库自带的针对一些基础数据类型进行操作的函数,比如常见的round(), time(), substring()等等。第一周将有25个系统函数作为基础任务发布给大家进行挑战,包含数学类函数,时间日期类函数,字符串类函数,有9个任务非常容易,16个任务稍微有一些难度,只要你有一定的go语言基础,看得懂英文文档,就能快速上手解决哦。 - 挑战任务-聚合函数(Aggregate function):所谓的聚合函数就是需要聚集一部分数据进行运算返回结果的函数,比如常见的sum(),count(),avg()等等。在MatrixOne中,实现聚合函数是要用到我们的大杀器因子化加速能力的,需要对因子化中的“环”数据结构理论有一定理解,实现会有一定复杂度,所以我们将5个聚合函数列为了挑战任务。 - ## 参与流程 在开始之前,先给MatrixOne项目Star, Fork, Watch一下吧。 -1. 选择很重要!加小助手微信“MatrixOrigin001”填写活动注册表https://www.wjx.top/vm/Ys1rz1I.aspx 选择你想要完成的函数任务,并加入MatrixOne社区群。 + +1. 选择很重要!加小助手微信“MatrixOrigin001”填写活动注册表 选择你想要完成的函数任务,并加入MatrixOne社区群。 2. 登陆Github,在你选择的函数issue留下你的comment,比如“I'd like to work on this issue”, 小助手会将相关issue分配给你。 3. 开始只属于你的函数体验任务。如有任何问题,MatrixOne社区群里的技术大牛全程在线支持。 > 请注意:1个开发者可以选择多个挑战任务,但是1个任务只能由1个开发者完成 - 来看下我们的任务列表吧,其中已经被assign的任务请查看[英文版活动说明](https://github.com/matrixorigin/matrixone/issues/1997): ### 1. 基础任务-数学类系统函数 - -- [ ] https://github.com/matrixorigin/matrixone/issues/1966 Mathematical Built-in function sin() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1967 Mathematical Built-in function cos() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1968 Mathematical Built-in function tan() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1969 Mathematical Built-in function cot() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1970 Mathematical Built-in function asin() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1971 Mathematical Built-in function acos() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1973 Mathematical Built-in function atan() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2094 Mathematical Built-in function sinh() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2095 Mathematical Built-in function cosh() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2096 Mathematical Built-in function crc32() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2097 Mathematical Built-in function sqrt() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2098 Mathematical Built-in function cbrt() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2099 Mathematical Built-in function rand() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2100 Mathematical Built-in function degrees() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2101 Mathematical Built-in function radians() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2102 Mathematical Built-in function sign() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2103 Mathematical Built-in function hypot() **[中等]** +- [ ] Mathematical Built-in function sin() **[容易]** +- [ ] Mathematical Built-in function cos() **[容易]** +- [ ] Mathematical Built-in function tan() **[容易]** +- [ ] Mathematical Built-in function cot() **[容易]** +- [ ] Mathematical Built-in function asin() **[容易]** +- [ ] Mathematical Built-in function acos() **[容易]** +- [ ] Mathematical Built-in function atan() **[容易]** +- [ ] Mathematical Built-in function sinh() **[容易]** +- [ ] Mathematical Built-in function cosh() **[容易]** +- [ ] Mathematical Built-in function crc32() **[容易]** +- [ ] Mathematical Built-in function sqrt() **[容易]** +- [ ] Mathematical Built-in function cbrt() **[容易]** +- [ ] Mathematical Built-in function rand() **[中等]** +- [ ] Mathematical Built-in function degrees() **[容易]** +- [ ] Mathematical Built-in function radians() **[容易]** +- [ ] Mathematical Built-in function sign() **[容易]** +- [ ] Mathematical Built-in function hypot() **[中等]** ### 2. 基础任务-日期时间类系统函数 - - -- [ ] https://github.com/matrixorigin/matrixone/issues/1974 Datetime Built-in function date() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1976 Datetime Built-in function utc_timestamp() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1977 Datetime Built-in function datediff() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1978 Datetime Built-in function dayofmonth() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1979 Datetime Built-in function dayofweek() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1980 Datetime Built-in function dayofyear() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2049 Datetime Built-in function month() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2046 Datetime Built-in function weekday() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2047 Datetime Built-in function yearweek() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2048 Datetime Built-in function week() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1830 Datetime Built-in function now() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2104 Datetime Built-in function quarter() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2105 Datetime Built-in function timestamp() **[中等]** +- [ ] Datetime Built-in function date() **[容易]** +- [ ] Datetime Built-in function utc_timestamp() **[容易]** +- [ ] Datetime Built-in function datediff() **[中等]** +- [ ] Datetime Built-in function dayofmonth() **[中等]** +- [ ] Datetime Built-in function dayofweek() **[中等]** +- [ ] Datetime Built-in function dayofyear() **[中等]** +- [ ] Datetime Built-in function month() **[中等]** +- [ ] Datetime Built-in function weekday() **[中等]** +- [ ] Datetime Built-in function yearweek() **[中等]** +- [ ] Datetime Built-in function week() **[中等]** +- [ ] Datetime Built-in function now() **[中等]** +- [ ] Datetime Built-in function quarter() **[中等]** +- [ ] Datetime Built-in function timestamp() **[中等]** ### 3. 基础任务-字符串类系统函数 -- [ ] https://github.com/matrixorigin/matrixone/issues/1984 String function lpad() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1985 String function ltrim() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1986 String function rpad() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1987 String function rtrim() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1988 String function repeat() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1989 String function reverse() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1990 String function space() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1991 String function replace() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2106 String function ascii() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2107 String function bit_length() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2108 String function empty() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2109 String function notEmpty() **[容易]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2110 String function bin() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2111 String function concat() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2112 String function hex() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2113 String function insert() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2114 String function locate() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2115 String function oct() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2116 String function lengthUTF8() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2117 String function startsWith() **[中等]** -- [ ] https://github.com/matrixorigin/matrixone/issues/2118 String function endsWith() **[中等]** +- [ ] String function lpad() **[中等]** +- [ ] String function ltrim() **[中等]** +- [ ] String function rpad() **[中等]** +- [ ] String function rtrim() **[中等]** +- [ ] String function repeat() **[中等]** +- [ ] String function reverse() **[中等]** +- [ ] String function space() **[中等]** +- [ ] String function replace() **[中等]** +- [ ] String function ascii() **[中等]** +- [ ] String function bit_length() **[容易]** +- [ ] String function empty() **[容易]** +- [ ] String function notEmpty() **[容易]** +- [ ] String function bin() **[中等]** +- [ ] String function concat() **[中等]** +- [ ] String function hex() **[中等]** +- [ ] String function insert() **[中等]** +- [ ] String function locate() **[中等]** +- [ ] String function oct() **[中等]** +- [ ] String function lengthUTF8() **[中等]** +- [ ] String function startsWith() **[中等]** +- [ ] String function endsWith() **[中等]** ### 4. 挑战任务-聚合函数 -- [ ] https://github.com/matrixorigin/matrixone/issues/1992 Aggregate function any() **[有挑战]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1993 Aggregate function bit_and() **[有挑战]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1994 Aggregate function bit_or() **[有挑战]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1995 Aggregate function bit_xor() **[有挑战]** -- [ ] https://github.com/matrixorigin/matrixone/issues/1996 Aggregate function stddev_pop() **[有挑战]** - +- [ ] Aggregate function any() **[有挑战]** +- [ ] Aggregate function bit_and() **[有挑战]** +- [ ] Aggregate function bit_or() **[有挑战]** +- [ ] Aggregate function bit_xor() **[有挑战]** +- [ ] Aggregate function stddev_pop() **[有挑战]** ## 在开始之前 + 1. 仔细阅读下MatrixOne社区的[贡献者指南](https://docs.matrixorigin.io/0.3.0/MatrixOne/Contribution-Guide/make-your-first-contribution/) 了解如何向MatrixOne提交代码. 2. 了解整个MatrixOne数据库项目, 参考[MatrixOne项目文档](https://docs.matrixorigin.io/). 3. 详细查看 [**系统函数构建指南**](https://docs.matrixorigin.io/0.3.0/MatrixOne/Contribution-Guide/Tutorial/develop_builtin_functions/) 与 [**聚合函数构建指南**](https://docs.matrixorigin.io/0.3.0/MatrixOne/Contribution-Guide/Tutorial/develop_aggregate_functions/),其中详细描述了如何在MatrixOne中开发系统函数和聚合函数,同时给出了很多样例代码。 ## 提交代码(Pull Request)要求 + 1. 注意在实现功能完成之后一定要写单元测试哦,否则你的PR是不会被社区采纳的。 2. 完成代码编写之后,按以下格式向MatrixOne提交PR: + * PR格式: [MatrixCamp] + function name + PR title * 标签 :[MatrixCamp] -* PR内容: 遵循[MatrixOne的PR模版] (https://github.com/matrixorigin/matrixone/blob/main/.github/PULL_REQUEST_TEMPLATE.md) +* PR内容: 遵循[MatrixOne的PR模版] () + 3. 提交PR完成后,在你的PR下面按以下格式评论: 评论格式: "I have finished Issue #" + PR link id @@ -120,12 +118,14 @@ A: 是的,参与开发者都需要在issue下面评论认领后再开始任 **Q: 为什么`select abs(-1);`和`select d, abs(-1) from t;`这样的语句会出问题?** A: 目前MatrixOne还不支持无表及常数参数的SQL语句,因此`select abs(-1);`和`select abs(-1) from table1;`这样的语句均会出错。正确的SQL语句是需要创建一张表,导入一些数据,然后再将列名作为参数运行built-in函数。如以下例子: + ```sql select abs(a) from t; ``` **Q: 为什么每次PR完成之后,我的仓库总是会比MatrixOne领先?** A: MatrixOne对所有pr的合并都要求是squash and merge,因此pr合并后跟主干会不一致。这里推荐采用的git流程,可以保持本地git,远端git仓库与MatrixOne仓库保持一致的方法: + ``` 1. 首先Fork MatrixOne的仓库。 2. clone自己的仓库到本地: git clone https://github.com/YOUR_NAME/matrixone.git @@ -137,13 +137,12 @@ A: MatrixOne对所有pr的合并都要求是squash and merge,因此pr合并后 8. 再次提交到自己的远端仓库:git push --force origin main:main ``` - - **Q: 我提交的PR在自动测试阶段失败了,这个是什么原因?** A:MatrixOne会在PR提交之后自动进行一系列CI及BVT测试,开发者在提交之后可以看到测试的进展及日志,如果是与函数功能相关的测试没有通过,请修改code后重新提交。如果是其他与函数无关的测试问题,可以在PR中进行评论,社区将会查询问题所在,不会影响本次函数任务的判定结果。目前MatrixOne的CI测试有一定的不稳定程度,因此可能有一些与函数无关的CI测试会fail。 **Q: MatrixOne服务启动之后的日志信息有点太多了,怎么能关掉?** A: 目前MatrixOne的默认日志级别是`DEBUG`级,所以信息是会比较多的。控制这个日志级别的是系统配置文件`system_vars_config.toml`,可以在调试的时候将该文件的`cubeLogLevel`与`level`两个参数设置成`ERROR`级别,这样打印的信息会少很多。 + ``` cubeLogLevel = "error" level = "error" @@ -154,6 +153,7 @@ A:如果是针对MatrixOne本身的测试和行为发现bug,欢迎向MatrixO **Q: 我启动了MatrixOne服务,并且用MySQL进行连接,但是好像没有获得正确的结果,如何才知道是否成功连接?** A: 如果你的MySQL客户端连接MatrixOne后打印如下信息,就说明已经成功连接: + ``` Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1002 @@ -170,15 +170,16 @@ Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Q: 我的MatrixOne服务启动了,但是我的MySQL客户端始终连接不上,这个应该怎么解决? A: 这个可能由各种原因导致,首先请关注错误的日志信息来定位问题,目前在MatrixOne中有两种常见错误: + 1. 端口冲突:有的时候因为端口被其他程序占用会有冲突,比如50000端口经常被占用。可以通过一下`lsof -i:50000`命令来查找是哪个进程在占用这个端口。从这个命令中可以获得这个进程的PID,再通过`kill -9 PIDNAME`关闭这个进程。 2. 存储不兼容:有的时候如果你从新的代码库拉取了最新的代码,但是存储数据是之前版本导入的数据,你可能也会面临连接失败问题。你可以尝试先将MatrixOne目录下的`Store`目录清空并重启MatrixOne服务。 - **Q: Mentor要求我对提交的代码格式进行缩进,这个如何做?** A:可以通过Golang语言自带的gofmt工具在命令行中进行操作,或者在一些常见的IDE如VS Code和GoLand中也均有相应的设置。 **Q: 如何理解MatrixOne的Vector数据结构?** A:Vector是MatrixOne中表示一列数据的结构,是MatrixOne最重要的数据结构体之一。它其中的不同变量含义: + ``` // Vector.Or: 表示这个Vector是否是从磁盘读取的原始Vector // Link: 这个Vector拥有的软链接个数 @@ -187,5 +188,3 @@ A:Vector是MatrixOne中表示一列数据的结构,是MatrixOne最重要的 // Col: 内存中经过序列化编码的数据,它与Vector.Data共享内存位置,但是会被转换到某个专门的类型,比如int32 // Nsp: 存储一列中所有NULL的位图 ``` - - diff --git a/docs/cn/MatrixOne/Overview/MatrixOne-Tech-Design/matrixone-techdesign.md b/docs/cn/MatrixOne/Overview/MatrixOne-Tech-Design/matrixone-techdesign.md index 041b946cf5d1c..9c4a1e706c741 100644 --- a/docs/cn/MatrixOne/Overview/MatrixOne-Tech-Design/matrixone-techdesign.md +++ b/docs/cn/MatrixOne/Overview/MatrixOne-Tech-Design/matrixone-techdesign.md @@ -4,9 +4,11 @@ 而本章主要给出MatrixOne架构的详细解释和组件介绍。 ## **MatrixOne架构特点** + MatrixOne当前整体架构可以用NewSQL+MPP来定义,并且正在进化成为一个为OLAP增强的分布式HTAP数据库,之后将开始向面向云边一体的场景进一步演进。另外MatrixOne将极简易用作为重要的设计准则,尽管是分布式数据库,但在部署上只提供单一Binary,每个节点只运行完全同样的单一进程即可。 ### **MatrixOne的NewSQL架构特点** + 众所周知,关系型数据库自SystemR确立了关系模型+SQL+事务处理老三样以来,已经存在了超过30年,直到NewSQL的出现。NewSQL是指以Google Spanner为起点,CockroachDB,TiDB,YugabyteDB等作为开源代表出现的分布式数据库,采用以复制状态机(Replicate State Machine)为核心,同时解决传统单机数据库伸缩性和高可用问题的分布式架构。 在计算机领域,复制状态机是实现容错服务的主要方式。状态机开始于给定的起始状态。每个收到的输入都通过状态转移机制来产生一个新的状态以及相应的输出。在复制状态机中,一组Server的状态机计算相同状态的副本,即使有一部分Server宕机了,它们仍然能够继续运行。一致性协议是复制状态机背景下提出的,用来保证复制日志的一致性,常用的一致性协议有Paxos,Raft等。在复制状态机架构下,通过挂载Key Value存储引擎进而实现OLTP能力,就是以上NewSQL的主要构型。 MatrixOne的当前架构,跟以上NewSQL数据库的区别在于,它是可以挂在多种存储引擎的。当前的0.2版本已经挂载了一个Key-Value存储引擎,用来存放Catalog等元数据。以及一个列存引擎,提供OLAP分析能力。当然,根据需要,它也可以挂载任意存储引擎,包括但不限于行存,图,专用时序,专用NoSQL等多模引擎。不同的存储引擎可以去满足不同场景中的应用,也非常欢迎社区的开发者来贡献想法和代码。 @@ -14,6 +16,7 @@ MatrixOne的当前架构,跟以上NewSQL数据库的区别在于,它是可 ![Raft的复制状态机实现](https://github.com/matrixorigin/artwork/blob/main/docs/overview/consensus-modules.png?raw=true) ### **MatrixOne的MPP架构特点** + MPP(Massively Parallel Processing)大规模并行处理是一种针对大规模的数据分析的计算架构。简单来说,MPP是将任务并行的分散到多个服务器和节点上,在每个节点上计算完成后,将各自部分的结果汇总在一起得到最终的结果。这个架构最早被Teradata和Greenplum等第一代OLAP数据库采用,后来为Hadoop体系奠基的MapReduce也借鉴了MPP架构的做法。但是两者在处理的数据体量,SQL的支持程度,数据处理类型及效率上有较大差别。用今天的概念来讲,Hadoop方案更偏数据湖,可以存储和处理上百PB数据,可以在读取的时候再定义schema,可以放大量的非结构化和半结构化数据,但是SQL支持,查询性能和实时流式处理不太理想。基于MPP架构的数据库方案更像是大幅强化了查询能力的关系型数据库,仍然兼具良好的SQL支持和ACID事务属性。新一代的开源MPP计算引擎代表有Clickhouse,Presto,Impala,GreenPlum,Apache Doris等。 MatrixOne也在MPP架构的基础上提供强大的OLAP能力,与其他项目不同的是。目前MatrixOne的MPP SQL计算引擎目前是用Golang实现的最快SQL引擎,相比C++的计算引擎,也可以在性能上一较高下。而且通过向量化和因子化加速之后,在如非主键join,多表复杂join等方面表现更优。 @@ -26,7 +29,6 @@ MatrixOne整体分为前端,计算层,元数据层,分布式框架和存 ![MatrixOne的整体架构](https://github.com/matrixorigin/artwork/blob/main/docs/overview/matrixone-modules.png?raw=true) - **组件介绍** * 前端SQL Frontend:这是MatrixOne的入口,目前MatrixOne提供MySQL兼容协议,以及MySQL语法(部分兼容)。SQL Frontend接收来自MySQL客户端的请求,解析后转到下一层。 @@ -50,7 +52,7 @@ MatrixOne整体分为前端,计算层,元数据层,分布式框架和存 接下来我们整体介绍MatrixOne的代码仓库结构,以便各位开发者对感兴趣的部分进行深入研究或者参与贡献。 -MatrixOne的内核代码都在`matrixone/pkg/ ` 这个文件夹下面。与上述架构图中对应的模块代码库位置: +MatrixOne的内核代码都在`matrixone/pkg/` 这个文件夹下面。与上述架构图中对应的模块代码库位置: * SQL Frontend:frontend/ * SQL Parser:sql/parser @@ -62,7 +64,6 @@ MatrixOne的内核代码都在`matrixone/pkg/ ` 这个文件夹下面。与上 * AOE:vm/engine/aoe * TPE:vm/engine/tpe - - ## **更多信息** + 如果你对以上某个模块感兴趣并想要尝试上手开发,请参照[贡献指南](../../Contribution-Guide/How-to-Contribute/preparation.md)。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Overview/NYC-Test-Performance.md b/docs/cn/MatrixOne/Overview/NYC-Test-Performance.md index 1b7491c47e957..43a307f9d86e8 100644 --- a/docs/cn/MatrixOne/Overview/NYC-Test-Performance.md +++ b/docs/cn/MatrixOne/Overview/NYC-Test-Performance.md @@ -1,14 +1,12 @@ # **NYC性能测试结果** ## **概述** -在MatrixOne v0.2.0版本,我们在单机上遵照[相关流程](../Get-Started/Tutorial/NYC-test-with-matrixone.md)实现了**纽约出租车数据测试**,并将测试结果与其他产品相比较,体现了MatrixOne在查询处理时间上的优异性。 - +在MatrixOne v0.2.0版本,我们在单机上遵照[相关流程](../Get-Started/Tutorial/NYC-test-with-matrixone.md)实现了**纽约出租车数据测试**,并将测试结果与其他产品相比较,体现了MatrixOne在查询处理时间上的优异性。 !!! note 说明 以下测试结果均取三次最好结果的平均值,以秒为单位 - ## **单机测试** !!! info 测试配置 @@ -26,12 +24,14 @@ ![柱状图](https://github.com/matrixorigin/artwork/blob/main/docs/overview/NYC_standalone.png?raw=true) ## **限制** + 在测试中对MatrixOne v0.2.0的查询语句进行了一些限制: * 不使用 `WHERE`过滤语句 * 暂不支持表分区,因此不使用`PARTITION`相关命令 ## **相关信息** + 本节内容展示了使用MatrixOne进行纽约出租车数据测试的结果。若想获取更多相关信息,请见: * [完成SSB测试](../Get-Started/Tutorial/SSB-test-with-matrixone.md) diff --git a/docs/cn/MatrixOne/Overview/SSB-Test-Performance.md b/docs/cn/MatrixOne/Overview/SSB-Test-Performance.md index 910ce446c73e0..a6ab773c2b2c8 100644 --- a/docs/cn/MatrixOne/Overview/SSB-Test-Performance.md +++ b/docs/cn/MatrixOne/Overview/SSB-Test-Performance.md @@ -1,20 +1,20 @@ # **SSB测试性能报告** ## **概述** + 在此,我们给出了使用MatrixOne在不同的硬件和查询条件下进行SSB测试的性能结果。 可参见[完成SSB测试](../Get-Started/Tutorial/SSB-test-with-matrixone.md)来复现整个测试结果,如果未能实现类似结果,可能需要检查硬件、负载或或测试流程是否存在问题,可以在GitHub上提出[issue](https://github.com/matrixorigin/matrixone/issues/new/choose)来报告具体问题。 在v0.2.0中,MatrixOne在单表、多表查询方面均有优异的表现,我们将MatrixOne的性能测试结果与其他数据库产品进行了比较。通过柱状图,可以看出MatrixOne在查询处理时间上有明显的优势。 推荐测试使用的服务器规格型号:x86 CPU,16核,64GB内存,CentOS 7+操作系统。 - !!! note 说明 以下测试结果均取三次最好结果的平均值,以秒为单位 - 为了展示单表查询能力,将五张表合成为一张宽表:`lineorder_flat`。 ## **单机单表** + 使用单机搭载MatrixOne执行对宽表`lineorder_flat`的查询,并与相同配置下的其他数据库进行比较。 `lineorder_flat`共有6亿行数据,共占据220 GB空间。 @@ -22,7 +22,6 @@ 测试所用服务器配置如下: AMD EPYC™ Rome CPU 2.6GHz/3.3GHz,16核,32GiB内存。 - | 查询编号 | MatrixOne v0.2.0 | ClickHouse v21.11.4.14 | :----: | :----: | :----: | Q2 | 2.71 |3.82 @@ -36,6 +35,7 @@ ![柱状图](https://github.com/matrixorigin/artwork/blob/main/docs/overview/SSB_standalone_single.png?raw=true) ## **单机多表** + 仍然使用单机环境,现对原始SSB测试数据集中的多个数据表进行查询,数据共有6亿行,主表占据67GB空间。 | 查询编号 | MatrixOne v0.2.0 | ClickHouse v21.11.4.14| Starrocks v1.19.3 @@ -49,7 +49,9 @@ | 总和 | 129.85|265.71|136.37 ![柱状图](https://github.com/matrixorigin/artwork/blob/main/docs/overview/SSB_standalone_multi.png?raw=true) + ## **集群多表** + 使用由三个节点组成的集群进行多表查询,其中每一个节点都按照单机进行安装部署。由测试结果可知,集群的查询时间明显短于单机查询,证明了MatrixOne的总体性能随着集群中节点个数增加而提高。 | 查询编号 | MatrixOne v0.2.0 | Starrocks v1.19.3 diff --git a/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-auto-rebalance-scheduling.md b/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-auto-rebalance-scheduling.md index 34d390052c96d..86083363eaa80 100644 --- a/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-auto-rebalance-scheduling.md +++ b/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-auto-rebalance-scheduling.md @@ -4,6 +4,7 @@ MatrixCube是一个实现分布式系统的框架。对于分布式系统来说 `Prophet`是MatrixCube的自平衡和调度的关键组件。`Prophet`中嵌入了`Etcd Server`组件来存储集群的元数据。 其主要实现了三个目标: + * 保持每个`Store`存储量平衡。 * 保持读写请求的负载平衡。 * 保持逻辑表分布平衡。 @@ -20,6 +21,7 @@ MatrixCube是一个实现分布式系统的框架。对于分布式系统来说 `Prophet`收集所有的`Heartbeat`,然后可以得到全局的`Replica`视图以及每个节点的存储空间信息。根据这些信息,`Prophet`将发送调度命令,将部分`Replica`转移到合适的`Store`上,以便保证每个`Store`上的`Replica`数目相近。由于每份`Replica`的数据量相同,因此`Shard`之间也能达到存储量的平衡。 ## **Replica Hearbeat** + 分布式体系下每一个`Shard`在各个`Store`上有相应的`Replicas`(副本),这些`Replica`形成了一个`Raft-Group`,并且将在组内选举Leader。Leader周期性地向`Prophet`发送`Heartbeat`,将包括一下信息: * 当前`Shard`所拥有的`Replica`数量,以及每个`Replica`的最新活跃时间。 @@ -35,4 +37,3 @@ MatrixCube是一个实现分布式系统的框架。对于分布式系统来说 ## **Event Notify** 收集到的`Heartbeat`信息将被同步到所有`Store`,从而每个`Store`中都能在本地形成全局路由信息。 - diff --git a/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-introduction.md b/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-introduction.md index cb76ef709932f..db90aa13e1eba 100644 --- a/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-introduction.md +++ b/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-introduction.md @@ -1,6 +1,5 @@ # **MatrixCube简介** - `MatrixCube`是一个基于`Multi-Raft`实现的自带调度能力的分布式存储框架,实现了集群的高可用性、强一致性与可扩展性。`MatrixCube`的设计目标是让开发人员只需要关注一个节点上的业务逻辑但却能够轻松实现各种强一致的分布式存储服务。我们可以使用`MatrixCube`来构建一些常见的分布式存储服务,比如:`分布式Redis`、`分布式KV`等等。 ## **MatrixCube框架** @@ -12,16 +11,17 @@ 我们首先需要阐明一些MatrixCube的核心概念。 ### **Store** + MatrixCube分布式系统包括一定数量的主机,数据正是存放在这些机器中——我们把集群中的每台计算机称之为`Store`。 ### **Shard** + 数据库中的数据是按逻辑组织成表,而数据又可以分成不同的分区进行存储,如此可以得到更好的扩展性。因此,数据在`Matrixcube`集群中分片存储,每个数据分片我们称之为一个`Shard`,而一个`Store`中可以管理多个`Shard`;当`Shard`的存储容量超过限制时,会进行分裂(Split)。 ### **Replica** 为了保证存储服务的高可用性,每个`Shard`的数据需要存储多份,并且分布在不同的`Store`上,`Shard`的一个数据副本我们称之为一个`Replica`。所以一个`Shard`会包含多个`Replica`,并且每个`Replica`中的数据都是相同的。 - ### **Raft-group与Leader** 多个数据副本存储在不同的`Store`上,一旦其中的一个副本更新,其他的副本也必须与之保持一致。无论客户端向哪个副本发出查询请求,都将得到相同的结果。为了保证数据的一致性,我们采用`Raft`协议来实现数据共识,一个`Shard`的多个`Replica`会组成一个`Raft-Group`。 @@ -33,7 +33,6 @@ MatrixCube分布式系统包括一定数量的主机,数据正是存放在这 `DataStorage`是实现分布式存储服务的接口,使用MatrixCube就必须要预先定义`DataStorage`,用来存储单机数据。基于`DataStorage`可以轻松构建一些常见的分布式存储服务。MatrixCube默认提供了一个完整的基于`KV`的DataStorage,因为基于`KV`的存储可以满足大部分的场景。 - ### **Prophet** `Prophet`是一个调度模块,主要职责是实现`Auto-Rebalance`,从而维持每个`Shard`的`Replica`数目均衡(本质上是为了保持`Store`之间的存储量与吞吐量均衡)。集群中初始的三个`Store`便是全部的`Prophet Nodes`。 @@ -54,16 +53,10 @@ MatrixCube分布式系统包括一定数量的主机,数据正是存放在这 更多相关信息:[Shard Proxy与Global Routing的工作机理](matrixcube-proxy-routing.md) - - - - - ## **主要特性** ### *强一致性** - MatrixCube实现了强大的一致性,它保证在任何数据成功写入之后,之后的读取将获得最新的值,而无论来自哪个节点。 ### **容错性** @@ -78,25 +71,18 @@ MatrixCube实现的分布式存储服务具有容错性、高可用性。若一 ### **Auto-Rebalance** - 分布式系统应该充分利用所有节点的计算能力和存储能力。对于MatrixCube集群,当增加或减少`Stores`时,将发生`Auto-Rebalance`,它将在`Store`之间转移数据,以达到每个`Store`的负载平衡。 - -详情请见[Auto-Rebalance的工作机制]:(matrixcube-auto-rebalance-scheduling.md)。 +详情请见[Auto-Rebalance的工作机制](matrixcube-auto-rebalance-scheduling.md)。 ### **Scale-out** -通过`shard splitting`与` auto-rebalance`,MatrixCube分布式系统能够横向扩展,集群存储和吞吐量能力与`Stores`的数量成比例。 +通过`shard splitting`与`auto-rebalance`,MatrixCube分布式系统能够横向扩展,集群存储和吞吐量能力与`Stores`的数量成比例。 ### **用户自定义存储引擎** MatrixCube对集群中每个数据存储引擎没有限制。换言之,任何存储引擎只要实现了MatrixCube定义的`DataStorage`接口,都可以搭建起基于MatrixCube的分布式系统。默认情况下,MatrixCube提供了一个基于`Pebble`的Key-Value存储引擎(`Pebble`是`RocksDB`的Go语言版本)。 - ### **用户自定义读写** MatrixCube作为一种通用分布式存储框架,可以构建不同的分布式存储系统。用户也可以自定义读写命令。只要它能够在单机版本中工作,MatrixCube就可以将其升级到分布式版本。 - - - - diff --git a/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-proxy-routing.md b/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-proxy-routing.md index dd8f407313674..d42d48b814e4e 100644 --- a/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-proxy-routing.md +++ b/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-proxy-routing.md @@ -7,13 +7,14 @@ 用户可以将该请求发送到系统里任意`Store`中,其中的`Shard Proxy`将处理该请求,它将通过全路由表`Global Routing` 来寻找到正确的`Store`。 正如我们对`Raft Group`与`Leader`的解释,`Leader` 代表了一个`Raft Group`,所有的读写操作只由它处理。因此,当我们执行对某些数据行的查询请求时: + * 首先,需要定位这些数据行所在的`Shard`。 * 其次,找到这个`Shard`所对应的`Raft Group`中的`Leader Replica`。 * 接着,将请求路由到`Leader Replica`所在的`Store`。 * 最后,`Leader Replica`执行请求并作出响应。 - ## **示例** + 如果我们有一个由三个`Store`组成的集群,它们的状态如下: ||Range|Store1|Store2|Store3| @@ -22,9 +23,6 @@ |Shard2|[key10-key20)|Follower|Leader|Follower| |Shard3|[key20-key30)|Follower|Follower|Leader| - 用户分别向key1,key10和key20数据发送请求,下图说明了请求如何通过`Shard Proxy`路由组件并被转发。 - ![User Request Routing Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/overview/matrixcube-requests.svg?raw=true) - diff --git a/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-shard-splitting.md b/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-shard-splitting.md index e0b6e9f2509e5..8728e324ae036 100644 --- a/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-shard-splitting.md +++ b/docs/cn/MatrixOne/Overview/matrixcube/matrixcube-shard-splitting.md @@ -1,6 +1,5 @@ # **Shard Splitting** - `Shard`是数据的一个分区或分片。分布式系统通常将庞大的数据切割为碎片并将之存储集群内不同的机器上,以此增强整体的存储能力并承担更大的工作负载。每个`Shard`都会有几个`Replica`作为副本,来维持高可用性,而一组`Replica`便组成了`Raft-Group`。 在MatrixCube的设计框架中,创建的新表是一个`Shard`。根据用户定义的容量限制参数,`Shard`有相应的大小限制。 @@ -8,4 +7,3 @@ 一旦两个新的`Raft-Groups`成立,将立即举行`re-election`操作。在大多数情况下,原始的`Replica leader`仍然会被选为leader。 下面的图表可以形象地解释这一机制: ![Shard Splitting](https://github.com/matrixorigin/artwork/blob/main/docs/overview/matrixcube-shard-splitting.svg?raw=true) - diff --git a/docs/cn/MatrixOne/Overview/matrixone-architecture.md b/docs/cn/MatrixOne/Overview/matrixone-architecture.md index 7b767feb1b1b5..803d2900cdb89 100644 --- a/docs/cn/MatrixOne/Overview/matrixone-architecture.md +++ b/docs/cn/MatrixOne/Overview/matrixone-architecture.md @@ -5,21 +5,21 @@ MatrixOne作为一个从零开始打造的全新数据库,其整体架构由多个模块组成。对应架构图如下图所示: ![MatrixOne Architecture](https://github.com/matrixorigin/artwork/blob/main/docs/overview/overall-architecture.png?raw=true) - - ## **查询解析层(Query Parser Layer)** + * **解析器(Parser):** 将SQL、流处理或Python语言解析为抽象语法树,以便进一步处理。 * **计划器(Planner):** 通过一系列基于规则、基于成本的优化算法找到最佳的执行计划,并将抽象语法树转换为计划树。 * **IR生成器(IR Generator):** 将Python代码转变为LLVM IR的中间码。 ## **计算层(Computation Layer)** + * **即时编译(JIT Compilation):** 在运行时使用LLVM将SQL计划树或IR代码转换为本地程序。 * **向量化执行(Vectorized Execution):** MatrixOne利用SIMD指令构造向量化执行通道。 * **缓存(Cache):** 用于查询的数据、索引和元数据的多版本的缓存。 ## **集群管理层(MatrixCube)** -MatrixCube是构建分布式系统的基础库,它保证数据库集群的高可靠性、强一致性和可扩展性。它用于保证分布式、有状态的应用程序构建,使开发人员只需要关注单节点的业务逻辑实现即可。MatrixCube目前基于`multi-raft`搭建来提供强一致能力,之后将迁移到`Paxos`,用于更好服务跨数据中心的应用场景。 +MatrixCube是构建分布式系统的基础库,它保证数据库集群的高可靠性、强一致性和可扩展性。它用于保证分布式、有状态的应用程序构建,使开发人员只需要关注单节点的业务逻辑实现即可。MatrixCube目前基于`multi-raft`搭建来提供强一致能力,之后将迁移到`Paxos`,用于更好服务跨数据中心的应用场景。 * **调度器(Prophet):** MatrixCube中用于管理、调度MatrixOne集群的工具。 * **事务管理器(Transaction Manager):** MatrixOne支持快照隔离级别(snapshot isolation)的分布式事务。 @@ -35,6 +35,7 @@ MatrixCube是构建分布式系统的基础库,它保证数据库集群的高 MatrixOne作为无需绑定底层基础设施的数据库,可以支持共享存储S3/HDFS,或本地磁盘、私有数据中心、混合云,甚至智能设备等存储介质的数据存储。 ## **相关信息** + 本节介绍了MatrixOne的整体架构概览。若您想了解更详细的模块技术设计问题,可阅读: [MatrixOne模块概览](MatrixOne-Tech-Design/matrixone-techdesign.md) diff --git a/docs/cn/MatrixOne/Overview/matrixone-introduction.md b/docs/cn/MatrixOne/Overview/matrixone-introduction.md index 366f588d2ff9f..b945fe474d141 100644 --- a/docs/cn/MatrixOne/Overview/matrixone-introduction.md +++ b/docs/cn/MatrixOne/Overview/matrixone-introduction.md @@ -3,7 +3,9 @@ MatrixOne是一款面向未来的超融合异构数据库,通过超融合数据引擎实现单一数据库系统支持TP、AP、Streaming等多种数据负载,通过异构云原生架构实现单一数据库系统支持公有云原生、私有云、边缘云部署和使用。从而简化开发运维,消简数据碎片,提升数据端到端存算性能和开发敏捷度。 ## **核心特性** + ### **超融合引擎** + * **超融合引擎** 融合数据引擎,单数据库即可支持TP、AP、时序、机器学习等混合工作负载。 @@ -12,7 +14,6 @@ MatrixOne是一款面向未来的超融合异构数据库,通过超融合数 利用独有的增量物化视图能力,无需跨数据库即可实现实时数据流处理。 - ### **异构云原生** * **异构统一** @@ -23,14 +24,12 @@ MatrixOne是一款面向未来的超融合异构数据库,通过超融合数 MatrixOne采用最优的一致性协议,实现业内最短网络延迟的多地多活。 - ### **极致的性能** * **高性能** 特有的因子化计算和向量化执行引擎,支持极速的复杂查询。单表、星型和雪花查询都具备极速分析性能。 - * **强一致** 提供跨存储引擎的高性能全局分布式事务能力,在保证极速分析性能的同时支持更新、删除和实时点查询。 @@ -39,24 +38,20 @@ MatrixOne是一款面向未来的超融合异构数据库,通过超融合数 存算分离,支持存储节点与计算节点独立扩缩容,高效应对负载变化。 - ## **用户价值** * **简化数据开发和运维** 随着业务发展,企业使用的数据引擎和中间件越来越多,而每一个数据引擎平均依赖5+个基础组件,存储3+个数据副本,每一个数据引擎都要各自安装、监控、补丁和升级。这些都导致数据引擎的选型、开发及运维成本高昂且不可控。在MatrixOne的一体化架构下,用户使用单个数据库即可服务多种数据应用,引入的数据组件和技术栈减少80%,大大简化了数据库管理和维护的成本。 - * **消减数据碎片和不一致** 在既有复杂的系统架构内,存在多条数据管道多份数据存储冗余。数据依赖复杂,导致数据更新维护复杂,上下游数据不一致问题频发,人工校对难度增大。MatrixOne的高内聚架构和独有的增量物化视图能力,使得下游可以支持上游数据的实时更新,摆脱冗余的ETL流程,实现端到端实时数据处理。 - * **无需绑定基础设施** 因为基础设施的碎片化,企业的私有化数据集群和公有云数据集群之间数据架构和建设方案割裂,数据迁移成本高。而数据上云一旦选型确定数据库厂商,后续的集群扩容、其他组件采购等都将被既有厂商绑定。MatrixOne提供统一的云边基础架构和高效统一的数据管理,企业数据架构不再被基础设施绑定,实现单数据集群跨云无感知扩缩容,提升性价比。 - * **极速的分析性能** 目前,由于缓慢的复杂查询性能以及冗余的中间表,数据仓库在业务敏捷性上的表现不尽人意,大量宽表的创建也严重影响迭代速度。MatrixOne通过特有的因子化计算和向量化执行引擎,支持极速的复杂查询,单表、星型和雪花查询都具备极速分析性能。 @@ -69,8 +64,8 @@ MatrixOne是一款面向未来的超融合异构数据库,通过超融合数 传统数仓无法兼顾性能和灵活度,性价比无法做到最优。MatrixOne基于存算分离的技术架构,支持存储节点与计算节点独立扩缩容,高效应对负载变化。 - ## **相关信息** 本节描述了MatrixOne的产品核心特性和用户价值主张,如果您想了解有关MatrixOne产品架构设计的更多信息,请参阅以下内容: + * [MatrixOne技术架构](matrixone-architecture.md) \ No newline at end of file diff --git a/docs/cn/MatrixOne/Overview/mysql-compatibility.md b/docs/cn/MatrixOne/Overview/mysql-compatibility.md index 92f27426d944e..0547e64371c0e 100644 --- a/docs/cn/MatrixOne/Overview/mysql-compatibility.md +++ b/docs/cn/MatrixOne/Overview/mysql-compatibility.md @@ -2,7 +2,6 @@ MatrixOne的SQL语法兼容了MySQL 8.0.23版本。 - | 语句类型 | 语法 | 兼容性 | | ---- | ---- | ---- | | DDL | CREATE DATABASE | 以中文作为表名会导致显示错误 | @@ -64,9 +63,3 @@ MatrixOne的SQL语法兼容了MySQL 8.0.23版本。 | | XOR | 暂不支持 | | | MAX, MIN, COUNT, AVG | 同MySQL | | | CAST | 部分支持 | - - - - - - diff --git a/docs/cn/MatrixOne/Overview/whats-new.md b/docs/cn/MatrixOne/Overview/whats-new.md index 6561616f1b550..36c3bea73dcfa 100644 --- a/docs/cn/MatrixOne/Overview/whats-new.md +++ b/docs/cn/MatrixOne/Overview/whats-new.md @@ -1,4 +1,5 @@ # **最新发布** MatrixOne的最新版本为0.3.0,发布于2022年3月10日,详情请见: + * [v0.3.0 发布公告](../Release-Notes/v0.3.0.md) diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/date.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/date.md index c0925f35d2950..f2bfa8af498cd 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/date.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/date.md @@ -9,16 +9,15 @@ ``` > DATE(expr) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | 必要参数。需要提取日期的date或者datetime格式的输入值 | - - ## **示例** - ```sql > drop table if exists t1; > create table t1(a date, b datetime); diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/dayofyear.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/dayofyear.md index 322fe67ba443e..a723dd5005ce0 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/dayofyear.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/dayofyear.md @@ -9,16 +9,15 @@ ``` > DAYOFYEAR(expr) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | 必要参数。需要提取天数的date格式的输入值 | - - ## **示例** - ```sql > drop table if exists t1; > create table t1(a date, b datetime,c varchar(30)); diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/month.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/month.md index 8b617b3f77a73..25f2c3503ccbb 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/month.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/month.md @@ -4,23 +4,20 @@ `MONTH()`函数返回了给定日期的月份(从1到12)。 - ## **函数语法** ``` > MONTH(date) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | date | 必要参数,需要提取月份的日期 | - - ## **示例** - - ```sql > drop table if exists t1; > create table t1(a date, b datetime); diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/utc_timestamp.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/utc_timestamp.md index 0aeb517bfee5e..5f7fc4782bcc8 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/utc_timestamp.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/utc_timestamp.md @@ -4,7 +4,6 @@ The function returns the current UTC date and time as a value in 'YYYY-MM-DD hh:mm:ss' or 'YYYYMMDDhhmmss' format, - ## **函数语法** ``` @@ -12,4 +11,5 @@ The function returns the current UTC date and time as a value in 'YYYY-MM-DD hh: ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/weekday.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/weekday.md index 2d0e2627fd1a2..676b784235ed2 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/weekday.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/weekday.md @@ -4,23 +4,20 @@ `WEEKDAY()`函数返回了输入日期在周内的序号(0 = 周一,1 = 周二, … 6 = 周日)。 - ## **函数语法** ``` > WEEKDAY(date) ``` + ## **参数释义** | 参数 | 说明 | | ---- | ---- | | date | 必要参数 | - - ## **示例** - ```sql > drop table if exists t1; > create table t1(a date,b datetime); diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/year.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/year.md index d5cbc3bd1ec16..6b3be1481746e 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/year.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Datetime/year.md @@ -4,20 +4,19 @@ `YEAR()`和`TOYEAR()`函数返回了给定日期的年份(从1000到9999)。 - ## **函数语法** ``` > YEAR(date) > TOYEAR(date) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | date | 必要参数,需要提取年份的日期 | - - ## **示例** ```sql @@ -35,10 +34,8 @@ +---------+-----------+ ``` - ## **限制** 目前只支持`yyyy-mm-dd` 和 `yyyymmddd`的数据格式。 -## **限制** MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/abs.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/abs.md index 619a3394bbe89..e18213889e7d0 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/abs.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/abs.md @@ -4,13 +4,14 @@ ABS(X)返回X的绝对值,或者NULL如果X是NULL. - ## **函数语法** ``` > ABS(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,可取任意数值数据类型 | @@ -34,4 +35,5 @@ ABS(X)返回X的绝对值,或者NULL如果X是NULL. ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/acos.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/acos.md index e985a20588817..5841561a4402b 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/acos.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/acos.md @@ -4,18 +4,18 @@ ACOS()函数返回给定数值的余弦(用弧度表示)。 - ## **函数语法** ``` > ACOS(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,可取任意数值数据类型 | - ## **示例** ```sql @@ -34,4 +34,5 @@ ACOS()函数返回给定数值的余弦(用弧度表示)。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/atan.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/atan.md index 3be12f90e35a0..ba81b36c70132 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/atan.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/atan.md @@ -4,18 +4,18 @@ ATAN()函数返回给定数值的反正切(用弧度表示)。 - ## **函数语法** ``` > ATAN(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,可取任意数值数据类型 | - ## **示例** ```sql @@ -34,4 +34,5 @@ ATAN()函数返回给定数值的反正切(用弧度表示)。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/ceil.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/ceil.md index 51356c981ab18..6c5c662b6f57a 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/ceil.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/ceil.md @@ -4,23 +4,20 @@ CEIL(X)函数返回不小于X的最小整数。 - ## **函数语法** ``` > CEIL(X) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | X | 必要参数,可取任意数值数据类型 | 对int类的绝对数值类型,返回值也是相同的绝对数值类型。对浮点数勒说,返回值也是浮点数。 - - - - ## **示例** ```sql @@ -65,4 +62,5 @@ CEIL(X)函数返回不小于X的最小整数。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/cos.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/cos.md index 36d6dd8161bd4..36b713f479441 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/cos.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/cos.md @@ -4,19 +4,18 @@ COS()函数返回输入参数(用弧度表示)的余弦值。 - ## **函数语法** ``` > COS(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,可取任意数值数据类型 | - - ## **示例** ```sql @@ -34,4 +33,5 @@ COS()函数返回输入参数(用弧度表示)的余弦值。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/cot.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/cot.md index 356fbf20e9bd9..4b7c271a50a3f 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/cot.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/cot.md @@ -4,19 +4,18 @@ COT()函数返回输入参数(用弧度表示)的余切值。 - ## **函数语法** ``` > COT(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,可取任意数值数据类型 | - - ## **示例** ```sql @@ -34,4 +33,5 @@ COT()函数返回输入参数(用弧度表示)的余切值。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/exp.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/exp.md index 65847216f4b53..004b1f3e41fd5 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/exp.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/exp.md @@ -9,14 +9,13 @@ EXP(number)函数返回以自然常数e为底的number的指数。 ``` > EXP(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,可取任意数值数据类型 | - - - ## **示例** ```sql @@ -35,4 +34,5 @@ EXP(number)函数返回以自然常数e为底的number的指数。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/floor.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/floor.md index 57fe8192550d6..7aa6181796691 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/floor.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/floor.md @@ -1,9 +1,8 @@ # **FLOOR()** ## **函数说明** -`FLOOR()`函数返回不大于某个数字的相应数位的数。 - +`FLOOR()`函数返回不大于某个数字的相应数位的数。 ## **函数语法** @@ -11,14 +10,14 @@ > FLOOR(number, decimals) > FLOOR(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,任何当前支持的数值数据 | | decimals| 可选参数,代表小数点后的位数。默认值为0,代表四舍五入为整数,当为负数时四舍五入到小数点前的数位。| - - ## **示例** ```sql @@ -79,4 +78,5 @@ ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/ln.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/ln.md index c8de6ba00d177..db4f40832b78d 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/ln.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/ln.md @@ -4,7 +4,6 @@ LN(X)返回X的自然对数. 这个函数是LOG(X)的同义函数。 - ## **函数语法** ``` diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/log.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/log.md index 624730894d2e3..fe1a48bdb3d5d 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/log.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/log.md @@ -4,18 +4,18 @@ LOG(X)函数返回X的自然对数。 - ## **函数语法** ``` > LOG(X) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | X | 必要参数,任何当前支持的数值数据 | - ## **示例** ```sql @@ -31,5 +31,6 @@ LOG(X)函数返回X的自然对数。 ``` ## **限制** + * LOG(X)目前仅支持单参数输入。 * MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/pi.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/pi.md index 7af6551665f6d..1a75ea8fd9879 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/pi.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/pi.md @@ -4,15 +4,12 @@ PI() 返回数学常量π (pi). - - ## **函数语法** ``` > PI() ``` - ## **示例** ```sql @@ -49,4 +46,5 @@ PI() 返回数学常量π (pi). ``` ## 限制 + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/power.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/power.md index 36b822dc4cb97..e73d37cd3b8f3 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/power.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/power.md @@ -4,20 +4,19 @@ POWER(X, Y) 返回X的Y次方指数值。 - - ## **函数语法** ``` > POWER(X, Y) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | X | 必要参数,任何当前支持的数值数据 | | Y | 必要参数,任何当前支持的数值数据 | - ## **示例** ```sql @@ -47,4 +46,5 @@ POWER(X, Y) 返回X的Y次方指数值。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/round.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/round.md index 4273cc622fd33..c79620fc2c6d7 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/round.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/round.md @@ -11,14 +11,14 @@ > ROUND(number, decimals) > ROUND(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,想要进行舍入的数值,可取任意数值数据类型 | | decimals| 可选参数,表示将要舍入的小数点后的位数。默认值为0,代表舍入到整数。
**decimals>0** 函数将舍入到小数点后的位数
**decimals<0** 函数将舍入到小数点前的位数
**decimals=0** 函数将舍入到整数| - - ## **示例** ```sql @@ -91,4 +91,5 @@ ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/sin.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/sin.md index ad604a7a58e1e..b183129ec2880 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/sin.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/sin.md @@ -4,13 +4,14 @@ SIN()函数返回输入参数(用弧度表示)的正弦值。 - ## **函数语法** ``` > SIN(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,可取任意数值数据类型 | @@ -32,4 +33,5 @@ SIN()函数返回输入参数(用弧度表示)的正弦值。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/sinh.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/sinh.md index dc3c1e876082c..a1f4d98b8a357 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/sinh.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/sinh.md @@ -4,13 +4,14 @@ SINH()函数返回输入参数(用弧度表示)的双曲正弦值。 - ## **函数语法** ``` > SINH(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,可取任意数值数据类型 | @@ -27,4 +28,5 @@ SINH()函数返回输入参数(用弧度表示)的双曲正弦值。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/tan.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/tan.md index 1a780664c1c35..3ac265c05e2a2 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/tan.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/Mathematical/tan.md @@ -4,19 +4,18 @@ TAN()函数返回输入参数(用弧度表示)的正切值。 - ## **函数语法** ``` > TAN(number) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | number | 必要参数,可取任意数值数据类型 | - - ## **示例** ```sql @@ -32,5 +31,7 @@ TAN()函数返回输入参数(用弧度表示)的正切值。 | -1.5574 | 0.0000 | +---------+---------+ ``` + ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/empty.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/empty.md index ac403a9914774..01ba7ed72a398 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/empty.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/empty.md @@ -9,7 +9,9 @@ ``` > EMPTY(str) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | str | 必要参数,CHAR与VARCHAR类型均可。 | @@ -20,7 +22,6 @@ ## **示例** - ```SQL > drop table if exists t1; > create table t1(a varchar(255),b varchar(255)); @@ -36,5 +37,5 @@ ``` ## **限制** -MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 +MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/endswith.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/endswith.md index 8a09139d032a4..aa4947db106d5 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/endswith.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/endswith.md @@ -4,19 +4,21 @@ 检查是否以指定后缀结尾。字符串如果以指定后缀结尾返回1, 否则则返回0。该函数是对大小写敏感的。 - ## **函数语法** ``` > ENDSWITH(str,suffix) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | str | 必要参数. CHAR和VARCHAR类型都支持.| | suffix | 必要参数. CHAR和VARCHAR类型都支持.| ## **返回值** + * 1, 如果字符串是以指定后缀结尾的。 * 0, 如果字符串不以指定后缀结尾的。 @@ -53,4 +55,5 @@ ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/length.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/length.md index 49bfd336ef7fc..506414b3902be 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/length.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/length.md @@ -4,21 +4,20 @@ `length()`函数返回了字符串的长度。 - ## **函数语法** ``` > LENGTH(str) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | str | 必要参数,想要计算长度的字符串 | - ## **示例** - ```sql > select a,length(a) from t1; @@ -29,4 +28,5 @@ abc 3 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/lengthUTF8.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/lengthUTF8.md index 759564359106f..5e7c2cdba3218 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/lengthUTF8.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/lengthUTF8.md @@ -4,21 +4,20 @@ `lengthUTF8()`以字符为单位返回字符串str的长度,一个多字节字符算作一个字符。 一个汉字所对应的字符长度是1。 - ## **函数语法** ``` > LENGTHUTF8(str) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | str | 必要参数,想要计算长度的字符串 | - ## **示例** - ```sql > drop table if exists t1; > create table t1(a varchar(255),b varchar(255)); @@ -32,4 +31,5 @@ ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/lpad.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/lpad.md index dc1e4dedcaadd..da2f7bc52ebff 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/lpad.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/lpad.md @@ -12,14 +12,13 @@ ``` ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | str |必要参数,被填充的字符串。CHAR与VARCHAR类型均可。| | len |必要参数,需要填充到的总长度。 | | padstr |必要参数,用于填充的字符串。CHAR与VARCHAR类型均可。| - - ## **示例** ```sql @@ -79,6 +78,6 @@ VALUES +------------+------------------+ ``` - ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/ltrim.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/ltrim.md index fbf689d1007f0..4ed675b019e2b 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/ltrim.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/ltrim.md @@ -9,13 +9,13 @@ LTRIM()将输入字符串的前部空格去除,返回处理后的字符。 ``` > LTRIM(char) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | char | 必要参数,CHAR 与 VARCHAR均可| - - ## **示例** ```sql @@ -32,4 +32,5 @@ LTRIM()将输入字符串的前部空格去除,返回处理后的字符。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/reverse.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/reverse.md index 8cc00ea8499ee..112fd09b080f6 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/reverse.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/reverse.md @@ -9,15 +9,15 @@ ``` > REVERSE(str) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | Str | 必要参数. 需要翻转的字符串. CHAR与VARCHAR类型均可. | - ## **示例** - ```SQL > drop table if exists t1; > create table t1(a varchar(12),c char(30)); @@ -53,5 +53,5 @@ ``` ## **限制** -MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 +MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/rpad.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/rpad.md index cdfd60d9971b3..d814a85d065b0 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/rpad.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/rpad.md @@ -12,14 +12,13 @@ ``` ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | str |必要参数,被填充的字符串。CHAR与VARCHAR类型均可。| | len |必要参数,需要填充到的总长度。 | | padstr |必要参数,用于填充的字符串。CHAR与VARCHAR类型均可。| - - ## **示例** ```sql @@ -79,6 +78,6 @@ VALUES +------------+------------------+ ``` - ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/rtrim.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/rtrim.md index c1e2b7e63b96d..457f0f0bef959 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/rtrim.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/rtrim.md @@ -9,13 +9,13 @@ RTRIM()将输入字符串的后方空格去除,返回处理后的字符。 ``` > RTRIM(char) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | char | 必要参数,CHAR 与 VARCHAR均可| - - ## **示例** ```sql @@ -32,4 +32,5 @@ RTRIM()将输入字符串的后方空格去除,返回处理后的字符。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/space.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/space.md index 71d946ef46575..fd3b8debd6142 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/space.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/space.md @@ -4,22 +4,20 @@ SPACE(N)返回N个空格组成的字符串。 - - ## **语法** ``` > SPACE(N) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | N | 必要参数. UINT类型 | - ## **示例** - ```SQL > drop table if exists t1; > CREATE TABLE t1 @@ -50,4 +48,5 @@ VALUES ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/startswith.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/startswith.md index dabcdffc20f2e..0074500fa6a69 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/startswith.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/startswith.md @@ -9,13 +9,16 @@ ``` > STARTSWITH(str,prefix) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | str | 必要参数. CHAR和VARCHAR类型都支持. | | prefix | 必要参数. CHAR和VARCHAR类型都支持. | ## **返回值** + * 1, 如果字符串是以指定前缀开始的。 * 0, 如果字符串不以指定前缀开始的。 @@ -51,4 +54,5 @@ ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/substring.md b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/substring.md index d997c2d89e490..99705c1a8f030 100644 --- a/docs/cn/MatrixOne/Reference/Builtin-Functions/String/substring.md +++ b/docs/cn/MatrixOne/Reference/Builtin-Functions/String/substring.md @@ -11,17 +11,17 @@ SUBSTR()是SUBSTRING()的同义词. > SUBSTRING(str,pos) > SUBSTR(str,pos,len) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | str | 必要参数,母字符串。CHAR与VARCHAR类型均可。 | | pos | 必要参数,开始位置 | | len | 可选参数,返回子字符串长度 | - ## **示例** - ```SQL > CREATE TABLE IF NOT EXISTS t1 ( pub_id varchar(8) COLLATE latin1_general_ci NOT NULL DEFAULT '', @@ -65,5 +65,6 @@ estd date NOT NULL DEFAULT '2000-01-01' ``` ## **限制** + * MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 * Substring函数目前不支持在函数中使用FROM与FOR操作符。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/Data-Types/data-types.md b/docs/cn/MatrixOne/Reference/Data-Types/data-types.md index a7d33ed6c53ea..867b7584a638e 100644 --- a/docs/cn/MatrixOne/Reference/Data-Types/data-types.md +++ b/docs/cn/MatrixOne/Reference/Data-Types/data-types.md @@ -5,8 +5,6 @@ MatrixOne 的数据类型与MySQL数据类型的定义一致,可参考: ## **整数类型** - - | 数据类型 | 存储空间 | 最小值 | 最大值 | | ---- | ---- | ---- | ---- | | TINYINT | 1 byte | -128 | 127 | @@ -38,7 +36,6 @@ MatrixOne 的数据类型与MySQL数据类型的定义一致,可参考: | Date | 4 byte | day | 1000-01-01 | 9999-12-31 | YYYY-MM-DD | | DateTime | 4 byte | second | 1970-01-01 00:00:00 | 2105-12-31 23:59:59 | YYYY-MM-DD hh:mm:ss | - ## **定点类型Decimal(Beta)** | 数据类型 | 存储空间 | 精度 | 语法表示 | diff --git a/docs/cn/MatrixOne/Reference/Data-Types/fixed-point-types.md b/docs/cn/MatrixOne/Reference/Data-Types/fixed-point-types.md index 86d245ffa6822..b0589a8d1ca41 100644 --- a/docs/cn/MatrixOne/Reference/Data-Types/fixed-point-types.md +++ b/docs/cn/MatrixOne/Reference/Data-Types/fixed-point-types.md @@ -13,8 +13,6 @@ salary DECIMAL(5,2) 如果小数精度为0的话,DECIMAL相当于纯整数,不含任何小数。 MatrixOne中DECIMAL类型的最大位数为38位。另外DECIMAL中指定的整数或小数位数在实际列被赋值的时候超出指定范围,实际数值将会被自动转换成相应精度。 - - ## Decimal数据类型特点 该部分内容主要介绍Decimal数据类型的一些特点,尤其是在位数精度和存储形式上的。 @@ -30,4 +28,3 @@ DECIMAL列的数值以二进制的形式进行存储,在MatrixOne内部,只 | 19-38 | 16个字节 | 对于详细的Decimal类型实现方法,可以参考Decimal的[设计文档](https://github.com/matrixorigin/matrixone/issues/1867)。 - diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/avg.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/avg.md index bd1a7a7d231f8..3a29486ce9100 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/avg.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/avg.md @@ -4,25 +4,25 @@ `AVG()`是聚合函数的一种,计算了参数列的算术平均值。 - ## **函数语法** ``` > AVG(expr) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | 任何数值类型的列的列名 | ## **返回值** + 以`Double`类型返回该列的算术平均值。 若输入参数为空,则返回`NaN`值。 ## **示例** - - ```sql > drop table if exists tbl1,tbl2; > create table tbl1 (col_1a tinyint, col_1b smallint, col_1c int, col_1d bigint, col_1e char(10) not null); @@ -62,4 +62,5 @@ ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_and.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_and.md index 4272770834bdf..8aa14733485dc 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_and.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_and.md @@ -9,12 +9,13 @@ BIT_AND()是一个聚合函数,计算了列中所有位的按位与。 ``` > BIT_AND(expr) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | UINT类型的列| - ## **示例** ```sql @@ -34,4 +35,5 @@ BIT_AND()是一个聚合函数,计算了列中所有位的按位与。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_or.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_or.md index 4bc77e2a86f95..14a3f92a09f55 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_or.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_or.md @@ -9,12 +9,13 @@ BIT_OR()是一个聚合函数,计算了列中所有位的按位与。 ``` > BIT_OR(expr) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | UINT类型的列| - ## **示例** ```sql @@ -34,4 +35,5 @@ BIT_OR()是一个聚合函数,计算了列中所有位的按位与。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_xor.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_xor.md index fb25c446155ba..d130f96e20ec3 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_xor.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_xor.md @@ -9,12 +9,13 @@ BIT_XOR()是一个聚合函数,计算了列中所有位的按位异或。 ``` > BIT_XOR(expr) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | UINT类型的列| - ## **示例** ```sql @@ -34,4 +35,5 @@ BIT_XOR()是一个聚合函数,计算了列中所有位的按位异或。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/count.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/count.md index 75de74f3204b7..3c7665e2a8680 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/count.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/count.md @@ -4,29 +4,27 @@ `COUNT()`是聚合函数的一种,计算了查询结果的记录数(`NULL`值不参与统计)。 - ## **函数语法** ``` > COUNT(expr) ``` + *** ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | 任何查询结果,既可以是列名,也可以是一个函数或者数学运算的结果。也可以使用`*`,直接统计行数。| ## **返回值** + 返回查询结果中`expr`列的`NOT NULL`的值的个数,返回数据类型为`BIGINT`。 如果没有匹配的行,将返回0。 - - ## **示例** - - ```sql > drop table if exists tbl1,tbl2; > create table tbl1 (col_1a tinyint, col_1b smallint, col_1c int, col_1d bigint, col_1e char(10) not null); @@ -53,5 +51,5 @@ ``` ## **限制** -MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 +MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/max.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/max.md index 8825d1846cbfa..27a671dd78764 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/max.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/max.md @@ -4,7 +4,6 @@ `MAX()`是聚合函数的一种,计算了一组值的最大值。 - ## **函数语法** ``` @@ -12,16 +11,17 @@ ``` ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | 任何数值类型与字符串列的列名| ## **返回值** + 返回`expr`列中的最大值,同时也可以在`MAX()`中使用字符串,如此会返回最大的字符串值。 ## **示例** - ```sql > drop table if exists tbl1,tbl2; > create table tbl1 (col_1a tinyint, col_1b smallint, col_1c int, col_1d bigint, col_1e char(10) not null); @@ -51,5 +51,7 @@ ``` *** + ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/min.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/min.md index 11771845b1f3f..66c480477f3b3 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/min.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/min.md @@ -4,7 +4,6 @@ `MIN()`是聚合函数的一种,计算了一组值的最小值。 - ## **函数语法** ``` @@ -12,12 +11,13 @@ ``` ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | 任何数值类型与字符串列的列名| - ## **返回值** + 返回`expr`列中的最小值,同时也可以在`MAX()`中使用字符串,如此会返回最小的字符串值。 ## **示例** @@ -51,4 +51,5 @@ ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/stddev_pop.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/stddev_pop.md index 52c84dbf22246..c6a6a5167aa39 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/stddev_pop.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/stddev_pop.md @@ -2,22 +2,20 @@ ## **函数说明** - - STDDEV_POP(expr)是一个聚合函数,计算总体标准差。 - ## **函数语法** ``` > STDDEV_POP(expr) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | 任何数值类型的列的列名 | - ## **示例** ```sql diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/sum.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/sum.md index 9c636c94bacd8..2d2a57d83a01b 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/sum.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/sum.md @@ -2,7 +2,6 @@ ## **函数说明** - `SUM()`聚合函数计算了一组值的和(NULL值被忽略)。 ## **函数语法** @@ -12,17 +11,18 @@ ``` ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | 任何数值类型与字符串列的列名| ## **返回值** + 返回`expr`列的数值的和,若输入参数为`Double`类型,则返回值为`Double`,否则为整数类型。 如果没有匹配的行,则返回`NULL`值。 ## **示例** - ```sql > drop table if exists tbl1,tbl2; > create table tbl1 (col_1a tinyint, col_1b smallint, col_1c int, col_1d bigint, col_1e char(10) not null); @@ -50,8 +50,9 @@ | 21 | +------+ ``` -*** +*** ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/var.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/var.md index 3bb8eae4e26e6..d95bf5fb98c31 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/var.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/var.md @@ -2,22 +2,20 @@ ## **函数说明** - - VAR(expr)是一个聚合函数,计算总体方差。 - ## **函数语法** ``` > VAR(expr) ``` + ## **参数释义** + | 参数 | 说明 | | ---- | ---- | | expr | 任何数值类型的列的列名 | - ## **示例** ```sql diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md index 916d07c731f67..679e67f9716de 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md @@ -1,6 +1,7 @@ # **CREATE DATABASE** ## **语法说明** + `CREATE DATABASE` 语句同于创建一个数据库。 ## **语法结构** @@ -15,11 +16,12 @@ } ``` -#### 语法图: +#### 语法图 ![Create Database Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/reference/create_database_statement.png?raw=true) ## **示例** + ``` > CREATE DATABASE test01; diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md index 290d0a4260ec5..b48ef668aa735 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md @@ -1,6 +1,7 @@ # **CREATE INDEX** ## **语法说明** + `CREATE INDEX` 语句为已有表`table_name`的某列添加新索引。 ## **语法结构** @@ -10,8 +11,8 @@ ``` - ## **示例** + ``` > CREATE INDEX PIndex ON Persons (LastName); diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-table.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-table.md index 7545bb6fe12a0..bc12310df24f2 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-table.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-table.md @@ -1,6 +1,7 @@ # **CREATE TABLE** ## **语法说明** + `CREATE TABLE` 语句用于在当前所选数据库创建一张新表。 ## **语法结构** @@ -14,11 +15,12 @@ ) ``` -#### 语法图: +#### 语法图 ![Create Table Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/reference/create_table_statement.png?raw=true) ## **示例** + ``` > CREATE TABLE test(a int, b varchar(10)); diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-database.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-database.md index 2d20ba8ff5a6b..51dd831052d2f 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-database.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-database.md @@ -1,6 +1,7 @@ # **DROP DATABASE** ## **语法说明** + 该语句用于删除一个数据库。 ## **语法结构** @@ -9,11 +10,12 @@ > DROP DATABASE [IF EXISTS] ``` -#### 语法图: +#### 语法图 ![Drop Database Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/reference/drop_database_statement.png?raw=true) ## **示例** + ``` > DROP DATABASE test01; ``` diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md index c339f9da31269..d91cb437f5bdc 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md @@ -1,7 +1,8 @@ # **DROP INDEX** ## **语法说明** -`DROP INDEX ` 从表`table_name` 中删除名为`index_name`的索引。 + +`DROP INDEX` 从表`table_name` 中删除名为`index_name`的索引。 ## **语法结构** @@ -9,8 +10,8 @@ > DROP INDEX index_name ON table_name; ``` - ## **示例** + ``` > DROP INDEX PIndex ON Persons; diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-table.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-table.md index dc29c411d2338..45cee78c45bb1 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-table.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-table.md @@ -1,6 +1,7 @@ # **DROP TABLE** ## **语法说明** + 该语句用于从当前所选的数据库中删除表,如果表不存在则会报错,除非使用 `IF EXISTS` 修饰符。 ## **语法结构** @@ -9,11 +10,12 @@ > DROP TABLE [IF EXISTS] [db.]name ``` -#### 语法图: +#### 语法图 ![Drop Table Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/reference/drop_table_statement.png?raw=true) ## **示例** + ``` > CREATE TABLE table01(a int); > DROP TABLE table01; diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md index ac9dc408279ee..6d105f5514f5c 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md @@ -1,13 +1,13 @@ # **PRIMARY KEY** ## **语法说明** + `PRIMARY KEY` 即主键约束,用于唯一标示表中的每条数据。 主键必须包含 `UNIQUE` 值,不能包含 `NULL` 值。 一个表只能有一个主键,但一个主键可以包含一个或多个列。 - - ## **在建表时创建主键** + 以下SQL语句在创建 `Persons` 表时,在其中的 `ID` 列创建主键: ``` @@ -20,8 +20,8 @@ ); ``` - 若要对主键进行命名,并指定多个列为主键,可参考如下语句: + ``` > CREATE TABLE Persons ( ID int NOT NULL, @@ -33,8 +33,7 @@ ``` !!! Note 注意区分 - 上述示例中只有一个主键 `PK_Person`, 但其中包含了两列(`ID `与`LastName`) - + 上述示例中只有一个主键 `PK_Person`, 但其中包含了两列(`ID`与`LastName`) ## **限制** diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/cast.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/cast.md index a7d84e6e6b404..d4bc199b05416 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/cast.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/cast.md @@ -1,28 +1,31 @@ # **CAST** ## **函数说明** + CAST()函数可以将任何类型的一个值转化为另一个特定类型 。 ## **语法语法** + ``` > CAST(value AS datatype) ``` ## **相关参数** + | 参数 | 说明 | | ---- | ---- | | value | 必要参数,待转化的值 | | datatype | 必要参数,目标数据类型 | - 目前,`cast` 可以进行如下转换: + * 数值类型之间转换,主要包括SIGNED,UNSIGNED,FLOAT,DOUBLE类型 * 数值类型向字符CHAR类型转换 * 格式为数值的字符类型向数值类型转换(负数需要转换为SIGNED) - ## *示例** + ```sql > drop table if exists t1; > CREATE TABLE t1 (a int,b float,c char(1),d varchar(15)); @@ -43,7 +46,9 @@ CAST()函数可以将任何类型的一个值转化为另一个特定类型 。 ``` ## **限制** + MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。 + * 非数值的字符类型无法转化为数值类型 * 日期格式的数值类型、字符类型无法转化为Date类型 * Date,Datetime类型无法转化为字符类型 diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/in.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/in.md index eee0f24b4145f..16a80d60d42cf 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/in.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/in.md @@ -5,12 +5,15 @@ `IN` 运算符可以在`WHERE`语句中指定特定的多个值,本质上是多个 `OR` 条件的简写。 ## **语法结构** + ``` > SELECT column1, column2, ... FROM table_name WHERE column_name IN (value1, value2, ...); ``` + ## **示例** + ``` sql > create table t2(a int,b varchar(5),c float, d date, e datetime); > insert into t2 values(1,'a',1.001,'2022-02-08','2022-02-08 12:00:00'); @@ -41,8 +44,6 @@ a b c d e ``` - - ## **限制** * 目前,`IN` 左侧只支持常数列表。 diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/inner-join.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/inner-join.md index 6008bff04a72e..6673bac1e3316 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/inner-join.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/inner-join.md @@ -1,10 +1,11 @@ # **INNER JOIN** ## **语法说明** -`INNER JOIN` 选取两个表中具有匹配值的数据记录。(等同于`JOIN`) +`INNER JOIN` 选取两个表中具有匹配值的数据记录。(等同于`JOIN`) ## **语法结构** + ``` > SELECT column_name(s) FROM table1 @@ -15,8 +16,6 @@ ON table1.column_name = table2.column_name; ## **参数释义** - - ## **示例** ```sql @@ -61,6 +60,6 @@ ON table1.column_name = table2.column_name; ``` - ## **限制** + 目前, `INNER JOIN`语句在进行某些查询时将导致崩溃(与服务器失去连接)。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md index 59819456b1b1f..2830bc511619b 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md @@ -1,6 +1,7 @@ # **INSERT** ## **语法描述** + `INSERT`用于在表中插入新行。 ## **语法结构** diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/like.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/like.md index 29cb1528c17aa..b262fc3913a06 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/like.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/like.md @@ -1,13 +1,16 @@ # **LIKE** ## **语法说明** + LIKE 操作符用于在 WHERE 子句中搜索列中的指定模式。 有两个通配符经常与LIKE操作符一起使用: + * 百分号(%) 代表了0、1或多个字符。 * 下划线(_) 代表单个字符。 ## **语法结构** + ``` > SELECT column1, column2, ... FROM table_name @@ -15,6 +18,7 @@ WHERE columnN LIKE pattern; ``` ## **示例** + ``` > SELECT * FROM Customers WHERE CustomerName LIKE 'a%'; //The following SQL statement selects all customers with a CustomerName starting with "a" @@ -40,4 +44,5 @@ WHERE CustomerName NOT LIKE 'a%'; //The following SQL statement selects all cust ``` ## **限制** + 现不支持`NOT LIKE`语句。 diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md index 682de9b892097..15405fbe1f291 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md @@ -1,6 +1,7 @@ # **LOAD DATA** ## **语法说明** + `LOAD DATA`语句以超快的速度从一个文本文件中读取数据然后存储到表中。 ## **语法结构** @@ -28,14 +29,16 @@ [SET col_name={expr | DEFAULT} [, col_name={expr | DEFAULT}] ...] ``` + * `TERMINATED BY`,`ENCLOSED BY`等分隔符的意义与`SELECT INTO`一致。 * `IGNORE number`可用来忽略从文件开始的第`number`行/列。 - ## **示例** + 可以在SSB测试中了解`LOAD DATA`语句的用法,请见 [Complete a SSB Test with MatrixOne ](../../../Get-Started/Tutorial/SSB-test-with-matrixone.zh.md) + ```sql > LOAD DATA INFILE '/ssb-dbgen-path/lineorder_flat.tbl ' INTO TABLE lineorder_flat; ``` diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md index afcebc94d52c7..8da8ec46fba42 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md @@ -1,7 +1,9 @@ # **SELECT** ## **语法描述** + `SELECT`语句用于从表中检索数据。 + ## **语法结构** ``` sql @@ -20,8 +22,8 @@ ] ``` - ### **SELECT INTO** + `SELECT INTO` statement enables a query result to be stored in variables or written to a file `SELECT INTO` 语句将查询结果存储在变量或者导出为文件。 @@ -30,7 +32,6 @@ * SELECT ... INTO ***var_list*** 可以检索列值并将其存储到变量中。 * SELECT ... INTO OUTFILE 将检索结果输出为文件,可以使用行/列分隔符来生成特定的格式。 - ``` sql > SELECT INTO OUTFILE 'file_name' @@ -62,14 +63,12 @@ !!! info 建议 如果不设置`MAX_FILE_SIZE`,当表的数据量很大时会输出一个极大的文件,可能因此发生导出失败的情况;因此我们建议您根据实际情况设置该值。 - #### 限制 * 相同目录下若存在同名文件,则会导致导出失败。 * 目前只支持导出 ***.csv*** 类型的文件。 * 目前只支持通过绝对路径将文件导出到服务器主机,而不能导出到远程客户端。 - ## **示例** ```sql diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-databases.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-databases.md index 6f853fc81c654..aee6d1f2c5c5c 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-databases.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-databases.md @@ -1,13 +1,17 @@ # **SHOW DATABASES** ## **语法说明** + 显示实例上存在的数据库列表。 ## **语法结构** + ``` > SHOW DATABASES [LIKE expr | WHERE expr] ``` + ## **示例** + ``` > SHOW DATABASES; +----------+ @@ -25,4 +29,3 @@ +----------+ 9 rows in set (0.00 sec) ``` - diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-tables.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-tables.md index 78555525285ca..add42938997e0 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-tables.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-tables.md @@ -1,12 +1,17 @@ # **SHOW TABLES** ## **语法说明** + 以列表的形式展现当前数据库创建的所有表。 + ## **语法结构** + ``` > SHOW TABLES [LIKE 'pattern' | WHERE expr | FROM 'pattern' | IN 'pattern'] ``` + ## **示例** + ``` > SHOW TABLES; +---------------+ diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/subquery.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/subquery.md index 17f5200ae458b..de9ac3f2a4e8e 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/subquery.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/subquery.md @@ -3,6 +3,7 @@ 子查询,也称为嵌套查询或子选择,是SELECT嵌入在另一个SQL查询的查询方式。 一个子查询有几类: + - SELECT子查询 - FROM子查询 - WHERE子查询 @@ -22,6 +23,7 @@ ``` ### **示例** + ```sql > CREATE TABLE tb1 (c1 INT, c2 CHAR(5), c3 FLOAT); > INSERT INTO tb1 VALUES (1, '1', 1.0); @@ -48,4 +50,5 @@ ``` ## **限制** + MatrixOne目前仅支持FROM子查询。 \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/use.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/use.md index 580ab08f5b67c..68609d4487eac 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/use.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/use.md @@ -1,13 +1,17 @@ # **USE** ## **语法说明** + `USE`语句用于选择当前数据库,在此数据库进行后续操作。 ## **语法结构** + ``` > USE db_name ``` + ## **示例** + ``` > USE db1; > SELECT COUNT(*) FROM mytable; diff --git a/docs/cn/MatrixOne/Reference/System-Parameters/configuration-settings.md b/docs/cn/MatrixOne/Reference/System-Parameters/configuration-settings.md index db0e135385613..f63315bd7c61e 100644 --- a/docs/cn/MatrixOne/Reference/System-Parameters/configuration-settings.md +++ b/docs/cn/MatrixOne/Reference/System-Parameters/configuration-settings.md @@ -3,6 +3,7 @@ MatrixOne的配置文件位于[matrixone/pkg/config/test/system_vars_config.toml](https://github.com/matrixorigin/matrixone/blob/main/pkg/config/test/system_vars_def.toml)。 ### 常规设置 + | 参数 | 数据类型 | 默认值 | 取值范围 | 作用 | | ---- | ---- | -------- | --- | --- | | rootpassword | string | "" | string value | 用户的密码| @@ -12,10 +13,8 @@ MatrixOne的配置文件位于[matrixone/pkg/config/test/system_vars_config.toml | sendRow | bool | false | [true, false] | send data row while producing | | dumpEnv | bool | false | [true, false] | dump Environment with memEngine Null nodes for testing | - ### Debug设置 - | 参数 | 数据类型 | 默认值 | 取值范围 | 作用 | | ---- | ---- | -------- | --- | --- | | level | string | debug | [debug, info, warn, error, fatal] | 日志输出级别 | @@ -25,7 +24,6 @@ MatrixOne的配置文件位于[matrixone/pkg/config/test/system_vars_config.toml | max-days | int64 | 0 | [0 - 314572800] | 日志文件保存的最大天数| | max-backups | int64 | 0 | [0 - 314572800] | 要保留的旧日志文件的最大数量| - ### 内存设置 | 参数 | 数据类型 | 默认值 | 取值范围 | 作用 | @@ -38,5 +36,3 @@ MatrixOne的配置文件位于[matrixone/pkg/config/test/system_vars_config.toml | processLimitationBatchRows | i | 42949672960 | [0 - 42949672960] | process.Limitation.BatchRows,默认值: 10 << 32 = 42949672960 |nt64 | processLimitationBatchRows | int64 | 42949672960 | [0 - 42949672960] | process.Limitation.BatchRows,默认值: 10 << 32 = 42949672960 | | processLimitationPartitionRows | int64 | 42949672960 | [0 - 42949672960] | process.Limitation.PartitionRows,默认值: 10 << 32 = 42949672960 | - - diff --git a/docs/cn/MatrixOne/Reference/System-Parameters/distributed-settings.md b/docs/cn/MatrixOne/Reference/System-Parameters/distributed-settings.md index 07983c6faf7e2..541a8f58b369b 100644 --- a/docs/cn/MatrixOne/Reference/System-Parameters/distributed-settings.md +++ b/docs/cn/MatrixOne/Reference/System-Parameters/distributed-settings.md @@ -2,8 +2,8 @@ 对于分布式系统部署和配置,应该注意以下参数。 - ### 配置设置 + 要修改分布式配置,需要在默认配置文件`system_vars_config.toml`中修改以下参数: * **nodeID** @@ -12,28 +12,26 @@ * **addr-raft 与 addr-advertise-raft** - `addr-raft`是raft组rpc通信时的地址,是节点的10000号端口。 ``` addr-raft = "localhost:10000" ``` - 只有使用 docker 部署时才需要调整`addr-advertise-raft`参数。 - 对于 docker部署来说,Ip为`0.0.0.0`: + ``` addr-raft = "0.0.0.0:10000" ``` 当部分客户端无法访问raft-group时,需要手动设置`addr-advertise-raft`。 + ``` addr-advertise-raft = "${HOST}:10000" ``` - * **addr-client 与 addr-advertise-client** `addr-client`是集群服务的地址,是节点的20000号端口。 @@ -44,18 +42,18 @@ 只有使用 docker 部署时才需要调整`addr-advertise-client`参数。 - 对于 docker部署来说,Ip为`0.0.0.0`: + ``` addr-client = "0.0.0.0:20000" ``` 当客户端无法通过Cube监听的默认客户端链接访问Cube时,必须手动设置``addr-advertise-client`。 + ``` addr-advertise-client = "${HOST}:20000" ``` - * **dir-data** `dir-data`是Cube数据的目录,在集群中,每个节点应该有不同的`dir-data`。 @@ -66,6 +64,7 @@ * **prophet name** 在`Prophet Configs` 中的`name`是节点名,在集群中,每个节点都有不同的`prophet name`。 + ``` name = "node0" ``` @@ -81,9 +80,11 @@ 只有使用 docker 部署时才需要调整`rpc-advertise-addr`参数。 对于 docker部署来说,Ip为`0.0.0.0`。 + ``` rpc-addr = "0.0.0.0:30000" ``` + 当客户端无法访问prophet时,必须手动设置`rpc-advertise-addr`。 ``` @@ -93,9 +94,11 @@ * **prophet-node** `prophet-node`表示节点类型,对于集群中的三个prophet节点来说,该参数为`true`。 + ``` prophet-node = true ``` + 对于存储节点(Pure Prophet Node)来说,该参数为`false`。 ``` @@ -105,11 +108,13 @@ * **external-etcd** 对于集群中的三个prophet节点来说,`external-etcd`参数为空。 + ``` external-etcd = ["", "", ""] ``` 对于存储节点,`external-etcd`参数为三个prophet节点的`client-urls`的列表,如:当prophet节点的端口号为40000时: + ``` external-etcd = ["http://ip_of_prophet_node1:40000", "http://ip_of_prophet_node2:40000", "http://ip_of_prophet_node3:40000"] ``` @@ -119,11 +124,13 @@ `join`是为了让第二个和第三个prophet节点加入raft组。 对于首个prophet节点,`join`取空值。 + ``` join = "" ``` 对于第二、三个prophet节点,`join`取首个节点的`peer-urls`值,如: + ``` join = "http://ip_of_the_first_prophet_node:40000" ``` @@ -132,8 +139,8 @@ * **client-urls 和 advertise-client-urls** - `client-urls` 公开给集群中的其他节点,是节点的40000号端口: + ``` client-urls = "http://localhost:40000" ``` @@ -146,6 +153,7 @@ ``` 当客户端无法通过prophet监听的默认客户端链接访问prophet时,需要手动设置`advertise-client-urls`: + ``` advertise-client-urls = "http://${HOST}:40000 ``` @@ -166,13 +174,14 @@ ``` 当节点无法被prophet节点监听到时,需要手动设置`advertise-peer-urls`: + ``` advertise-peer-urls = "http://${HOST}:50000" ``` * **max-replicas** `max-replicas`是prophet组中最大副本数,应该设置为3。 + ``` max-replicas = 3 ``` - diff --git a/docs/cn/MatrixOne/Release-Notes/v0.1.0.md b/docs/cn/MatrixOne/Release-Notes/v0.1.0.md index 582d10ad07ddf..86147297906b8 100644 --- a/docs/cn/MatrixOne/Release-Notes/v0.1.0.md +++ b/docs/cn/MatrixOne/Release-Notes/v0.1.0.md @@ -5,6 +5,7 @@ *** ## **Docker** + 可以使用docker拉取MatrixOne 0.1.0版本。 *** @@ -14,14 +15,18 @@ *** ### **SQL** + 本次发布的版本支持一下SQL语句: *** ### **DDL** + * CREATE / DROP DATABASE * CREATE / DROP TABLE + ### **DML** + * INSERT * LOAD DATA * SELECT @@ -33,16 +38,21 @@ - DATABASES - TABLES * USE + ### **数据类型** + * TINYINT / SMALLINT / INT / BIGINT, SIGNED / UNSIGNED * FLOAT / DOUBLE * CHAR / VARCHAR + ### **运算符** + * <, >=, <, <=, <>, !=, = * BETWEEN … AND …, NOT BETWEEN … AND … * AND, &&, OR, || * +, -, *, /, %, MOD, DIV, NEG * CAST + ### **聚合函数** * COUNT @@ -52,7 +62,9 @@ * MIN ## **数据引擎** + *** + * 支持MySQL语法 * 内置的AOE列存引擎可作为融合性数据库引擎 * 支持实时分析查询 @@ -62,6 +74,7 @@ * 通过对RAFT日志和Write-Ahead日志的复用设计,使复制状态机的性能得到了极大的提高 ## **贡献者们** + *** 截止本次发布,共有16位贡献者为MatrixOne的开发作出贡献,共产生了453次提交记录。此外,我们格外感谢首次为MatrixOne作出贡献的开发者! @@ -82,5 +95,3 @@ Xu Peng (@XuPeng-SH) Yan Wenze(@nnsgmsone) Zilong Zhou (@zzl200012) Zhang Yingfeng (@yingfeng) - - diff --git a/docs/cn/MatrixOne/Release-Notes/v0.2.0.md b/docs/cn/MatrixOne/Release-Notes/v0.2.0.md index 797d81e2f4720..c46b77b304535 100644 --- a/docs/cn/MatrixOne/Release-Notes/v0.2.0.md +++ b/docs/cn/MatrixOne/Release-Notes/v0.2.0.md @@ -1,11 +1,11 @@ # **MatrixOne v0.2.0发布报告** - 热烈祝贺MatrixOne的 v0.2.0版本正式发布!以下我们将对版本最新的更新内容进行陈列。 *** ## **Docker** + 可以使用docker拉取MatrixOne0.2.0版本。 *** @@ -24,11 +24,13 @@ * 支持新数据类型DATE与DATETIME ## **已发现的问题** + *** * 当在脚本中进行一连续的建表操作时,集群中的`pre-allocate-group-num`参数应该设置为更大的值。否则,过程中会报错"no available raft group"。 ## **贡献者们** + *** 截止本次发布,共有21位贡献者为MatrixOne的开发作出贡献,共产生了243次提交记录。 diff --git a/docs/cn/MatrixOne/Release-Notes/v0.3.0.md b/docs/cn/MatrixOne/Release-Notes/v0.3.0.md index 50c4cc999608b..e9c3b7f5cfe87 100644 --- a/docs/cn/MatrixOne/Release-Notes/v0.3.0.md +++ b/docs/cn/MatrixOne/Release-Notes/v0.3.0.md @@ -3,9 +3,11 @@ 热烈祝贺MatrixOne的 v0.3.0版本正式发布!以下我们将对版本最新的更新内容进行陈列。 ## Docker + 可以使用docker拉取MatrixOne0.3.0版本。 ## 最新特性 + - 将数据导出至CSV文件 - 引入了并行执行,提升了查询速度 - 引入了`IN`运算符,在`WHERE`子句中指定多个值 @@ -13,7 +15,6 @@ - 引入了函数round()与floor() - 在分布式系统中引入了`Chaos`测试框架 - ## 已发现的问题 - 当在脚本中进行一连续的建表操作时,集群中的`pre-allocate-group-num`参数应该设置为更大的值。否则,过程中会报错"no available raft group"。 @@ -45,14 +46,14 @@ - Zhang Yingfeng (@yingfeng) ## 欢迎新人 -* @wanhanbo首次贡献于https://github.com/matrixorigin/matrixone/pull/1600 -* @ikenchina首次贡献于https://github.com/matrixorigin/matrixone/pull/1685 -* @sundy-li首次贡献于https://github.com/matrixorigin/matrixone/pull/1704 -* @WenhaoKong2001首次贡献于https://github.com/matrixorigin/matrixone/pull/1838 + +* @wanhanbo首次贡献于 +* @ikenchina首次贡献于 +* @sundy-li首次贡献于 +* @WenhaoKong2001首次贡献于 我们期待您的贡献,欢迎来到MatrixOne社区! ## 更详细的更新日志 -https://github.com/matrixorigin/matrixone/compare/v0.2.0...v0.3.0 - + diff --git a/docs/cn/MatrixOne/Release-Notes/v0.4.0.md b/docs/cn/MatrixOne/Release-Notes/v0.4.0.md index 4b29a01b9c7f3..6cf817ca43e15 100644 --- a/docs/cn/MatrixOne/Release-Notes/v0.4.0.md +++ b/docs/cn/MatrixOne/Release-Notes/v0.4.0.md @@ -3,12 +3,15 @@ 热烈祝贺MatrixOne的 v0.4.0版本正式发布!以下我们对版本最新的更新内容进行简要说明。 ## Docker + 可以使用docker拉取MatrixOne0.4.0版本。 + ``` docker pull matrixorigin/matrixone:0.4.0 ``` ## 最新特性 + - 支持等式运算符Inner Join - 支持From子查询 - 新增decimal类型 @@ -19,7 +22,6 @@ docker pull matrixorigin/matrixone:0.4.0 - 新增以下聚合函数: - Bit_and, Bit_or, Bit_xor, Stddev_pop, Var - ## 仍存在的已知问题 - 当在脚本中进行一连续的建表操作时,集群中的`pre-allocate-group-num`参数应该设置为更大的值。否则,建表过程中会报错"no available raft group"。 @@ -64,5 +66,4 @@ docker pull matrixorigin/matrixone:0.4.0 ## 更详细的更新日志 -https://github.com/matrixorigin/matrixone/compare/v0.2.0...v0.3.0 - + diff --git a/docs/cn/MatrixOne/glossary.md b/docs/cn/MatrixOne/glossary.md index ddcadbd6726dd..0e07f4e519a64 100644 --- a/docs/cn/MatrixOne/glossary.md +++ b/docs/cn/MatrixOne/glossary.md @@ -32,11 +32,8 @@ | Shard Splitting | 当一个Shard超过了规定的存储容量限制时,MatrixCube将会把该Shard分裂(Split)为两个存储量相当的Shard。 | | Shard Proxy | Shard Proxy是接受用户读写请求的中心模块,在收到请求后将其发送到相应的节点以做出回应| - ### **重要概念** - - | 概念 |定义 | | ---- | ---- | | A | | diff --git a/docs/cn/README.md b/docs/cn/README.md index f5d93103b9544..45679936cdbbb 100644 --- a/docs/cn/README.md +++ b/docs/cn/README.md @@ -2,7 +2,6 @@ 欢迎来到MatrixOne官方文档网站! - MatrixOne是一款致力于“One Size Fits Most”的超融合异构数据库。 MatrixOne通过超融合数据引擎实现单一数据库系统支持TP、AP、Streaming等多种数据负载,通过异构云原生架构实现单一数据库系统支持公有云原生、私有云、边缘云部署和使用。从而简化开发运维,消简数据碎片,提升数据端到端存算性能和开发敏捷度。 @@ -10,6 +9,7 @@ MatrixOne通过超融合数据引擎实现单一数据库系统支持TP、AP、S 如果你发现了任何文档问题,请直接在GitHub上创建issue报告该问题,或者直接提出PR来修复! ## **推荐阅读 👉** + | 概述 | 快速上手 | 参考指南 | ---- | ---- | ---- | [MatrixOne简介](MatrixOne/Overview/matrixone-introduction.md) | [MatrixOne安装部署](MatrixOne/Get-Started/install-standalone-matrixone.md) | [SQL参考指南](MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md) diff --git a/docs/en/MatrixOne/Contribution-Guide/Code-Style/code-of-conduct.md b/docs/en/MatrixOne/Contribution-Guide/Code-Style/code-of-conduct.md index 802f211a9ba22..0584510912e97 100644 --- a/docs/en/MatrixOne/Contribution-Guide/Code-Style/code-of-conduct.md +++ b/docs/en/MatrixOne/Contribution-Guide/Code-Style/code-of-conduct.md @@ -68,9 +68,9 @@ members of the project's leadership. ## **Attribution** This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +available at [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq \ No newline at end of file + \ No newline at end of file diff --git a/docs/en/MatrixOne/Contribution-Guide/Code-Style/commit-pr-style.md b/docs/en/MatrixOne/Contribution-Guide/Code-Style/commit-pr-style.md index 668ac182c7946..f736a6438ad18 100644 --- a/docs/en/MatrixOne/Contribution-Guide/Code-Style/commit-pr-style.md +++ b/docs/en/MatrixOne/Contribution-Guide/Code-Style/commit-pr-style.md @@ -49,6 +49,7 @@ Please follow the following style for **all your commits**: - If the changes affect three or more subsystems, you can use `*` instead, like `*:`. - Use a lowercase letter on the text that immediately follows the colon. For example: "media: **update** the DM architecture image" - Do not add a period at the end of a commit message. + - For the second line, always leave it blank. - For the why part, if there is no specific reason for the change, you can use one of the generic reasons like "Improve performance", "Improve test coverage." - For other lines, use no more than 80 characters. @@ -72,7 +73,6 @@ Please follow the following style for **all your commits**: - Do not use lengthy compound words - Do not abbreviate unless it's absolutely necessary - ## Pull Request description style For Pull Request description in the `Conversation` box, please refer to the following Pull Request description template and include necessary information: diff --git a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-code.md b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-code.md index 819e4ea6fd72b..44a58bd7b16a9 100644 --- a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-code.md +++ b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-code.md @@ -1,13 +1,14 @@ # **Contribute Code** + MatrixOne is an open-source project maintained, improved, and extended by code contributors. This document describes the conventions about development workflow, some styles and templates you need while contributing code to MatrixOne. If you encounter any problem or find some mistakes in participating in contribution to MatrixOne, please [file an issue](https://github.com/matrixorigin/matrixone/issues) in GitHub or contact us on other platforms we support. - ## **Before Contributions** -Before you start developing, make sure you have read [Preparation](preparation.md) where you can follow the instructions to learn more about MatrixOne, development knowledge and how to set up the development environment. +Before you start developing, make sure you have read [Preparation](preparation.md) where you can follow the instructions to learn more about MatrixOne, development knowledge and how to set up the development environment. ## **Get familiar with style** + It's necessary to keep a consistent style for code, code comments, commit messages, and pull requests when contributing to MatrixOne. When you put together your pull request, we highly recommend you comply with the following style guides which make MatrixOne easy to review, maintain and develop. * **Code Style** @@ -22,6 +23,7 @@ The coding style suggested by the Golang community is used in MatrixOne. See the See the [Commit Message & Pull Request Style](../Code-Style/code-comment-style.md) for details. ## **Workflow** + You can follow the workflow to operate development, and you can see [Make Your First Contribution](../make-your-first-contribution.md) if you are a newcomer and need more detailed instructions about workflow. *1.* Fork the [MatrixOne repository](https://github.com/matrixorigin/matrixone) on GitHub. @@ -30,6 +32,7 @@ You can follow the workflow to operate development, and you can see [Make Your F ``` git clone git@github.com:/matrixone.git ``` + And add MatrixOne repo as a remote repository with: ``` @@ -37,6 +40,7 @@ git remote add upstream https://github.com/matrixorigin/matrixone.git ``` *3.* Create a new branch, the branch name is up to you. + ``` git checkout -b topic-branch ``` @@ -44,6 +48,7 @@ git checkout -b topic-branch *4.* Commit changes to your own branch locally, add necessary unit tests. *5.* Push to a new branch in your own fork. + ``` git push origin main:NEW_BRANCH ``` @@ -51,10 +56,13 @@ git push origin main:NEW_BRANCH *6.* Go back to GitHub, and submit a pull request in `NEW_BRANCH` so that we can review your changes. Add some labels if needed, and don't forget to [refer to the related issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue). *7.* Once your PR get approved, it would be merged sooner. After merging, synchronize your local repository. + ``` git pull --force upstream main:main ``` -*8. *Synchronized the `main` branch of your remote repository in Github. + +*8.*Synchronized the `main` branch of your remote repository in Github. + ``` git push --force origin main:main ``` @@ -62,6 +70,7 @@ git push --force origin main:main If you still have some trouble, please refer to [GitHub Docs](https://docs.github.com/en) for help. ## **Code review** + When you open a pull request, you can assign some reviewers, or just leave it blank. And you can add some related labels so that it would be easier to recognize the PR's type/priority/etc. During reviewing, reviewers would comment on your code snippet, you could modify the code on your topic branch locally, commit the changes, and push to GitHub, the new commits would be attached to the PR automatically. For detailed code review tips, See [Review a pull request](review-a-pull-request.md) for details. diff --git a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-documentation.md b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-documentation.md index c48b7c2d80630..4d2f2c691c742 100644 --- a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-documentation.md +++ b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-documentation.md @@ -6,10 +6,6 @@ Contributions to the MatrixOne documentation are welcome from everyone. The Matr Before you contribute please take a minute to familiarize yourself with basic [Markdown](https://www.markdownguide.org/basic-syntax/) syntax and have a look at our [Code of Conduct](../Code-Style/code-of-conduct.md) and the [Google Developer Documentation Style Guide](https://developers.google.com/style/) for some guidance on how to write accessible, consistent, and inclusive documentation. - - - - ## **How is MatrixOne documentation project organized?** The MatrixOne documentation is managed in 3 repositories: @@ -24,11 +20,6 @@ The `matrixorigin.io` repo contains a submodule that links to `matrixone` repo c The documentation project is based on the [mkdocs-material](https://github.com/squidfunk/mkdocs-material). You can find the corresponding syntax and commands with this project. - - - - - ## **MatrixOne Documentation Structure** The MatrixOne documentation content is planned with 6 main modules. @@ -53,39 +44,45 @@ The MatrixOne documentation content is planned with 6 main modules. If you are just correcting a typo or grammatical error, feel free to go ahead and [create a pull request](https://github.com/matrixorigin/matrixone/pulls). - - - ### **Contribute Workflow** *1*. [File an issue](https://github.com/matrixorigin/matrixone/issues/new/choose) and assign it to yourself by commenting`/assign`. *2*. Fork [matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io) and [matrixone](https://github.com/matrixorigin/matrixone) repos. *3*. Clone the [matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io) repo, using `--recursive` to retrieve the submodule of [matrixone](https://github.com/matrixorigin/matrixone) repo. + ``` $ git clone --recursive git@github.com:yourusername/matrixorigin.io.git ``` + Clone the [matrixone](https://github.com/matrixorigin/matrixorigin.io) repo to the other folder in local: + ``` $ git clone git@github.com:yourusername/matrixone.git ``` *4*. Add `matrixone` repo as a remote repository in your local matrixone folder with: + ``` git remote add upstream https://github.com/matrixorigin/matrixone.git ``` + Add `matrixorigin.io` repo as a remote repository in your local matrixorigin.io folder with: + ``` git remote add upstream https://github.com/matrixorigin/matrixorigin.io.git ``` *5*. As the local repo has the full documentation project code, you can run `mkdocs serve` under `matrixorigin.io` folder, and check `http://localhost:8000` to check if this project runs well. + ``` $ mkdocs serve ``` + *6*. Make your modification. If the modification is about the project settings, updating the sitemap with new pages, or updating the CI&CD workflow code. You can always check `http://localhost:8000` to see if your modification is effective. If your modification is about the markdown contents, after you update the `docs` submodule of `matrixorigin.io`, the same modifcation should be applied to the `matrixone` repo. *7*. Push your git commits to your remote Github `matrixorigin.io` and `matrixone` repos. We recommend you to push to a new branch using the following commands: + ``` git push origin main:NEW_BRANCH ``` @@ -98,10 +95,13 @@ git push origin main:NEW_BRANCH So once your pull requests are merged, the update to the website is not immediate. We'll need to run a manual launch to update it. *10*. At last, you should update your local and remote repo to help keep committing history clean. Override your local committing repo with: + ``` git pull --force upstream main:main ``` + Update the `main` branch of your remote repo in Github: + ``` git push --force origin main:main ``` @@ -109,7 +109,6 @@ git push --force origin main:main !!! note Most processes should be implemented in both `matrixorigin.io` and `matrixone`. - ## **Contribute a blog article** If you would like to write an article for our blog, please [file an issue](https://github.com/matrixorigin/matrixone/issues/new/choose) or send it to [dengnan@matrixorigin.io](mailto:dengnan@matrixorigin.io). Feel free to submit either a completed draft or article ideas. All submissions will be reviewed as quickly as possible. If your article or idea seems like a good fit for the blog, we will reach out to you directly. \ No newline at end of file diff --git a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/make-a-design.md b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/make-a-design.md index c56e49c431333..7cd3dbd806566 100644 --- a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/make-a-design.md +++ b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/make-a-design.md @@ -1,17 +1,19 @@ # **Make a Design Proposal** + Many changes, including bug fixes and documentation improvements, can be implemented and reviewed via the normal GitHub pull request workflow, which we have already introduced in the previous chapter. Differently, when you come up with a new feature you need or expect MatrixOne to achieve, we encourage you to propose your idea and express it as technique design documents. Therefore, this page is intended to guide you to provide a consistent and controlled path for new features to enter the MatrixOne projects, so that all stakeholders can understand fully enough about the direction the project is evolving in. This page defines the best practices procedure for making a proposal in MatrixOne projects. ## **Before writing a design document** + Making enough preparations ahead of the design document can not only promote your working efficiency but increase the likelihood to be accepted. Oppositely, a rough and casual design document may be so much solow-quality so that it'll be rejected quickly. We motivate you to ask for help from experienced developers in order to obtain valuable suggestions to frame your design architecture or fill in details, which undoubtedly will upgrade the document to be desirable. The most common channel for preparing for writing a design document is on the Github issue. You can file a `Feature Request` or `Refactoring Request` to discuss about your ideas. - ## **Process** + Generally, you can follow these steps to finish the whole process: * Create an issue describing the problem, goal, and solution. diff --git a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md index 97e3d78a48156..b44c98290f738 100644 --- a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md +++ b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md @@ -1,28 +1,27 @@ # **Preparation** + Before contributing, it's necessary to make some preparations to learn more about MatrixOne and other revalant information, which can improve developing and reviewing efficiency. Thanks for understanding that English is used as a shared language in this repository. Maintainers do not use machine translation to avoid miscommunication due to errors in translation. If descriptions of issue / PR are written in non-English languages, those may be closed. If English is not your native language and you aren't sure about any of these, don't hesitate to ask for help in your pull request! - - - ## **What is MatrixOne** + ### Basic Information + You can see [MatrixOne Introduction](../../Overview/matrixone-introduction.md) for key features of MatrixOne, [MatrixOne Architecture](../../Overview/matrixone-architecture.md) for MatrixOne architecture and operational logic. For our distributed framework, see [MatrixCube Tech Design](./../../Overview/matrixcube/natrixcube-introduction.md). Besides, you can browse [SQL Reference](../../Reference/SQL-Reference/Data-Definition-Statements/create-database.md) and [Custom Functions](../../Reference/Customer-Functions/year.md) to know more about our interactive details. These introductions will help you go through you the key concepts and user details to understand the project. - ### Roadmap + MatrixOne v0.3.0 has been released, you can see [Release Notes](../Release-Notes/v0.3.0.md) to know more information. Currently, we are working at v0.4.0 and v0.5.0 releases, the job tasks of these releases are listed in the Github milestones [0.4.0](https://github.com/matrixorigin/matrixone/milestone/5). For the long-term project roadmap, please refer to [MatrixOne roadmap](https://github.com/matrixorigin/matrixone/issues/613) for a more general overview. - ## **What Contributions Can I Make** Contributions to MatrixOne are not limited to writing code. What follows are different ways to participate in the MatrixOne project and engage with our vibrant open-source community. See [Types of Contributions](types-of-contributions.md) for more details. @@ -31,11 +30,6 @@ Contributions to MatrixOne are not limited to writing code. What follows are dif * To propose a new feature, please file a [new feature request](https://github.com/matrixorigin/matrixone/issues/new/choose). Describe the intended feature and discuss the design and implementation with the team and community. Once the team agrees on the plan, you can follow the [Contribution Workflow](contribute-code.md#workflow) to implement it. * To implement a feature or bug-fix for an existing outstanding issue, follow the [Contribution workflow](contribute-code.md#workflow). If you need more context on a particular issue, comment on the issue to let people know. - - - - - ## **Working Directories and Files** For contributing code, [matrixone](https://github.com/matrixorigin/matrixone) is the main repository you'll be working on. The main working directories are listed below: @@ -62,8 +56,6 @@ For different technical modules, a code structure under `/pkg` is as following t | **vm/engine/tpe** | Transaction Processing Engine | | **buildin/** | System builtin functions | - - For contributing documentation, [matrixone](https://github.com/matrixorigin/matrixone), [matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io) and [artwork](https://github.com/matrixorigin/artwork) are all the main repositories you'll be working on. For more details, please refer to [Contribute Documentation](contribute-documentation.md). | Directory | Working Files | @@ -73,11 +65,10 @@ For contributing documentation, [matrixone](https://github.com/matrixorigin/matr | **matrixorigin.io/mkdocs.yml** | The configuration file of documentation website | | **artwork/docs** | The images, screenshots and diagrams of documentation webstie | - - ## **Set up your Development Environment** ### **Go Environment** + MatrixOne is written in Go. Before you start contributing code to MatrixOne, you need to set up your GO development environment. 1. Install `Go` version **1.18**. You can see [How to Write Go Code](http://golang.org/doc/code.html) for more information. @@ -91,9 +82,8 @@ export PATH=$PATH:$GOPATH/bin !!! Note MatrixOne uses [`Go Modules`](https://github.com/golang/go/wiki/Modules) to manage dependencies. - - ### **Github & Git** + MatrixOne is an open-source project built on Github, providing project maintainers and contributors with a platform to work together. Thus in order to start working with MatrixOne repository, you will need a **GitHub** account and learn basic **git** commands. If you don't have a Github account, please register at [https://github.com](https://github.com). In case you do not have [SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh) keys, you should generate them and then upload them on GitHub. It is required for sending over your patches. It is also possible to use the same SSH keys that you use with any other SSH servers - probably you already have those. For detailed information about Github, you can see [Github Docs](https://docs.github.com/en). diff --git a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/report-an-issue.md b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/report-an-issue.md index 13eb90af9812d..24d4d8b200130 100644 --- a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/report-an-issue.md +++ b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/report-an-issue.md @@ -1,11 +1,14 @@ # **Report Issues** + Any problem is encouraged to be published when you participate in MatrixOne, and you can [report issues](https://github.com/matrixorigin/matrixone/issues/new/choose) about this problem in GitHub with relative templates and labels we suggest. This page is intended to introduce templates, labels, and precautions you will follow when you report issues. ## **Avoid Duplicated Issues** + Before reporting an issue, you should see whether the problem has already been reported. You can use the [search bar](https://docs.github.com/en/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests) to search existing issues. ## **Issue Templates** + If the problem you're reporting is not already in the issue tracker, you can file an issue with your GitHub account. MatrixOne uses issue templates for different kinds of issues. Issue templates are a bundle of questions to collect necessary information about the problem to make it easy for other contributors to participate. MatrixOne suggests 6 types of issue templates: @@ -36,7 +39,6 @@ A `Documentation Issue` consists of information below: * **Additional context** Add any other context about the problem here. - A `Performance Question` consists of information below: * **Detail Environment** @@ -58,7 +60,6 @@ A concise description of the reason/motivation. * **Anything else** Anything that will give us more dectail about your issue! - A `Refactoring Request` consists of information below: * **Is your refactoring request related to a problem?** @@ -81,13 +82,12 @@ Before asking a question, make sure you have: - [MatrixOne Readme](https://github.com/matrixorigin/matrixone) - [MatrixOne Doc](https://docs.matrixorigin.io/) - ## **Issue Labels** Once your issue is submitted, it will be automatically labeled with `needs-triage`, a MatrixOne maintainer will look at the issue, tag it with more suitable labels and assign it to a suitable developer. If you'd like to work on the issue by yourself, you can comment `/assign` on the issue you would like to work on, you will be automatically assigned to the issue. You can then find yourself listed under Assignees section. ## **Good First Issues** + When you make the first contribution to MatrixOne, you can select one of the issues labeled [`good-first-issues`](https://github.com/matrixorigin/matrixone/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) each of which is relatively approachable for first-time contributors. For detailed suggestions you need when you make the first contribution, you can see [Make Your First Contribution](../make-your-first-contribution.md). - diff --git a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/review-a-pull-request.md b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/review-a-pull-request.md index 2ee6c74339f64..bd9641edb7c0e 100644 --- a/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/review-a-pull-request.md +++ b/docs/en/MatrixOne/Contribution-Guide/How-to-Contribute/review-a-pull-request.md @@ -1,8 +1,10 @@ # **Reviews** + For MatrixOne, any type of review for a pull request is crucial, where you can classify the pull request to help look for more suitable experts to solve relative problems or propose your suggestions to codes for not only contents but style. It's not necessary to doubt whether your review is constructive and useful enough because no matter how tiny, a suggestion may make a profound influence on MatrixOne. Certainly, before reviewing we wish you can browse this page to learn basic requirements and relative methods. ## **Principles of the code review** + When you review a pull request, there are several rules and suggestions you should take to propose better comments. Regardless of the specifics, we suggest you stay friendly first: @@ -27,6 +29,7 @@ It's difficult to decide whether it's more reasonable to accept or reject when y Some pull request authors may not be familiar with MatrixOne, MatriOne development workflow, or MatrixOne community. They don't know what labels should be added to the pull requests and which expert could be asked for a review. If you are able to, it would be great for you to triage the pull requests, add suitable labels to the pull requests, asking corresponding experts to review the pull requests. These actions could help more contributors notice the pull requests and make quick responses. ## **Checking pull requests** + There are some basic aspects to check when you review a pull request: * **Concentration** @@ -41,4 +44,3 @@ There are some basic aspects to check when you review a pull request: If a pull request changes how users build, test, interact with, or release code, you must check whether it also updates the related documentation such as `README.md` and any generated reference docs. Similarly, if a pull request deletes or deprecates code, you must check whether or not the corresponding documentation should also be deleted. * **Performance** If you find the pull request may affect performance, you could ask the author to provide a benchmark result. - diff --git a/docs/en/MatrixOne/Contribution-Guide/Tutorial/develop_aggregate_functions.md b/docs/en/MatrixOne/Contribution-Guide/Tutorial/develop_aggregate_functions.md index f556891614b03..ee19ab34fe5bc 100644 --- a/docs/en/MatrixOne/Contribution-Guide/Tutorial/develop_aggregate_functions.md +++ b/docs/en/MatrixOne/Contribution-Guide/Tutorial/develop_aggregate_functions.md @@ -1,6 +1,7 @@ # **Develop an aggregate function** ## **Prerequisite** + To develop an aggregate function for MatrixOne, you need a basic knowledge of Golang programming. You can go through this excellent [Golang tutorial](https://www.educative.io/blog/golang-tutorial) to get some Golang basic concepts. ## **Preparation** @@ -8,7 +9,6 @@ To develop an aggregate function for MatrixOne, you need a basic knowledge of Go Before you start, please make sure that you have `Go` installed, cloned the `MatrixOne` code base. Please refer to [Preparation](../How-to-Contribute/preparation.md) and [Contribute Code](../How-to-Contribute/contribute-code.md) for more details. - ## **What is an aggregation function?** In database systems, an aggregate function or aggregation function is a function where the values of multiple rows are grouped together to form a single summary value. @@ -36,7 +36,6 @@ In MatrixOne's implementation, the factorisation method pushs down the calculati a lot in computational and storage cost. This factorisation is realized by the `Ring` interface and its inner functions. - To checkout more about the factorisation theory and factorized database, please refer to [Principles of Factorised Databases](https://fdbresearch.github.io/principles.html). ## **What is a `Ring`** @@ -47,7 +46,6 @@ An algebraic `Ring` is a set equipped with two binary operations `+` (addition) A `Ring` in MatrixOne is an interface, with several functions similar to the algebraic `Ring` structure. We use `Ring` interface to implement aggragate functions, the `+`(addition) is defined as merging two `Ring`s groups, the `⋅`(multiplication) operation is defined as the computation of a grouped aggregate value combined with its grouping key frequency information. - | Method of Ring Interface | Do What | | ------------------------ | ------------------------------------------------------ | | Count | Return the number of groups | @@ -68,17 +66,13 @@ the `+`(addition) is defined as merging two `Ring`s groups, the `⋅`(multiplica | BatchAdd | Merge several couples of groups for two Rings | | Mul | Multiplication between groups for two Rings, called when join occurs | - - The implementation of `Ring` data structure is under `/pkg/container/ring/`. - ## **How does `Ring` work with query:** To better understand the `Ring` interface, we can take aggregate function `sum()` as an example. We'll walk you through the whole process of `Ring`. - There are two different scenarios for aggregation functions with `Ring`s. *1. Query with single table.* @@ -108,16 +102,21 @@ select class, sum(age) from T1 group by class; ``` For example, if two `Ring`s were generated, the first `Ring` holds the group sums of the first 4 rows, which will be like: + ```sql | one | 23+20+22 | | two | 20 | ``` + The second `Ring` holds the group sums of the last 6 rows, which will be like: + ```sql | two | 19 | | three | 18+20+21+24+19 | ``` + Then the `Add` method of `Ring` will be called to merge two groups together, and at last the `Eval` method will return the overall result to user. + ```sql | one | 23+20+22 | | two | 20+19 | @@ -171,13 +170,13 @@ for performing `join` operation. The `Ring-Tc` is created in the same time as `join` is performed. This `Ring-Tc` will count the appearing frequency `f` of id. Then the `Mul` method of `Ring-Ts` is called, to calculate the sum calculated from the `Ring-Ts` and frequency from `Ring-Tc`. + ``` sum[i] = sum[i] * f[i] ``` Now we get values of `[class, sum(age)]`, then performing a group by with class will give us the final result. - ## **The secret of factorisation** From the above example, you can see that the `Ring` performs some pre calculations and only the result(like `sum`) is stored in its structure. When performing operations like `join`, @@ -187,6 +186,7 @@ deal with costly Cartesian product. As the joined table number increases, the fa Take the implementation of `Variance` function as an example. The variance formula is as below: + ``` Variance = Σ [(xi - x̅)^2]/n @@ -201,6 +201,7 @@ as we store all values during processing. But in the `Avg` implementation, it doesn't store all values in the `Ring`. Instead it stores only the `sum` of each group and the null numbers. It returns the final result with a simple division. This method saves a lot of memory space. Now let's turn the `Variance` formula a bit to a different form: + ``` Variance = Σ (xi^2)/n-x̅^2 @@ -254,7 +255,6 @@ In our code repository, the file `pkg/sql/viewexec/transformer/types.go` registe and we assign each operator a distinct integer number. To add a new function `var()`, add a new const `Variance` in the const declaration and `var` in the name declaration. - ```go const ( Sum = iota @@ -416,6 +416,7 @@ You can checkout the full implmetation at [variance.go](https://github.com/matri } ``` + * `Eval` function ```go @@ -468,22 +469,16 @@ You can checkout the full implmetation at [variance.go](https://github.com/matri } ``` - - *3. Implement encoding and decoding for `VarRing`* - In the `pkg/sql/protocol/protocol.go` file, implement the code for serialization and deserialization of `VarRing`. - | Serialization function | Deserialization function | | ------------------ | ----------------------------------- | | EncodeRing | DecodeRing
DecodeRingWithProcess | - Serialization: - ```go case *variance.VarRing: buf.WriteByte(VarianceRing) @@ -552,12 +547,12 @@ Deserialization: Here we go. Now we can fire up MatrixOne and try with our `var()` function. - ## **Compile and run MatrixOne** Once the aggregation function is ready, we could compile and run MatrixOne to see the function behavior. Step1: Run `make config` and `make build` to compile the MatrixOne project and build binary file. + ``` make config make build @@ -567,6 +562,7 @@ make build `make config` generates a new configuration file, in this tutorial, you only need to run it once. If you modify some code and want to recompile, you only have to run `make build`. Step2: Run `./mo-server system_vars_config.toml` to launch MatrixOne, the MatrixOne server will start to listen for client connecting. + ``` ./mo-server system_vars_config.toml ``` @@ -578,11 +574,9 @@ Step2: Run `./mo-server system_vars_config.toml` to launch MatrixOne, the Matrix level = "error" - !!! info Sometimes a `port is in use` error at port 50000 will occur. You could checkout what process in occupying port 50000 by `lsof -i:50000`. This command helps you to get the PIDNAME of this process, then you can kill the process by `kill -9 PIDNAME`. - Step3: Connect to MatrixOne server with a MySQL client. Use the built-in test account for example: user: dump @@ -593,11 +587,9 @@ $ mysql -h 127.0.0.1 -P 6001 -udump -p Enter password: ``` - Step4: Test your function behavior with some data. Below is an example. You can check if you get the right mathematical variance result. You can also try an `inner join` and check the result, if the result is correct, the factorisation is valid. - ```sql mysql>select * from variance; +------+------+ @@ -642,19 +634,17 @@ mysql> select variance.a, var(variance.b) from variance inner join variance2 on 2 rows in set (0.04 sec) ``` - Bingo! - !!! info Except for `var()`, MatrixOne has already some neat examples for aggregate functions, such as `sum()`, `count()`, `max()`, `min()` and `avg()`. With some minor corresponding changes, the procedure is quite the same as other functions. ​ ## **Write unit Test for your function** - We recommend you to also write a unit test for the new function. Go has a built-in testing command called `go test` and a package `testing` which combine to give a minimal but complete testing experience. It automates execution of any function of the form. + ``` func TestXxx(*testing.T) ``` @@ -664,7 +654,6 @@ To write a new test suite, create a file whose name ends `_test.go` that contain Step1: Create a file named `variance_test.go` under `pkg/container/ring/variance/` directory. Import the `testing` framework and the `reflect` framework we are going to use for testing. - ```go package variance @@ -752,21 +741,20 @@ You can check the complete test code of `VarRing` there. ``` - - Step4: Launch Test. Within the same directory as the test: + ``` go test ``` + This picks up any files matching packagename_test.go. If you are getting a `PASS`, you are passing the unit test. In MatrixOne, we have a `bvt` test framework which will run all the unit tests defined in the whole package, and each time your make a pull request to the code base, the test will automatically run. You code will be merged only if the `bvt` test pass. - ## **Conduct a Performance Test** Aggregate function is an important feature of a database system, with queries on hundreds of millions of data rows, the time consumption of aggregate function is quite significant. diff --git a/docs/en/MatrixOne/Contribution-Guide/Tutorial/develop_builtin_functions.md b/docs/en/MatrixOne/Contribution-Guide/Tutorial/develop_builtin_functions.md index 2b01553bdddd7..f37711e7486cc 100644 --- a/docs/en/MatrixOne/Contribution-Guide/Tutorial/develop_builtin_functions.md +++ b/docs/en/MatrixOne/Contribution-Guide/Tutorial/develop_builtin_functions.md @@ -172,13 +172,16 @@ func init() { } ``` + some annotations for this code snippet above: 1.process.Get: MatrixOne assigns each query a "virtual process", during the execution of a query, we may need to generate new Vector, allocate memory for it, and we do it using this Get function + ```go // proc: the process for this query, size: the memory allocation size we are asking for, type: the new Vector's type. func Get(proc *Process, size int64, typ types.Type) (*vector.Vector, error) ``` + since we need a float32 vector here, its size should be 4 * len(origVecCol), 4 bytes for each float32. 2.encoding.DecodeFloat32Slice: this is just type casting. @@ -357,6 +360,7 @@ Here we go. Now we can fire up MatrixOne and take our abs function for a little Once the function is ready, we could compile and run MatrixOne to see the function behavior. Step1: Run `make config` and `make build` to compile the MatrixOne project and build binary file. + ``` make config make build @@ -366,6 +370,7 @@ make build `make config` generates a new configuration file, in this tutorial, you only need to run it once. If you modify some code and want to recompile, you only have to run `make build`. Step2: Run `./mo-server system_vars_config.toml` to launch MatrixOne, the MatrixOne server will start to listen for client connecting. + ``` ./mo-server system_vars_config.toml ``` @@ -384,6 +389,7 @@ Step3: Connect to MatrixOne server with a MySQL client. Use the built-in test ac user: dump password: 111 + ``` $ mysql -h 127.0.0.1 -P 6001 -udump -p Enter password: @@ -420,10 +426,12 @@ Bingo! !!! info Except for `abs()`, MatrixOne has already some neat examples for built-in functions, such as `floor()`, `round()`, `year()`. With some minor corresponding changes, the procedure is quite the same as other functions. ​ + ## **Write a unit Test for your function** We recommend you to also write a unit test for the new function. Go has a built-in testing command called `go test` and a package `testing` which combine to give a minimal but complete testing experience. It automates execution of any function of the form. + ``` func TestXxx(*testing.T) ``` @@ -448,7 +456,9 @@ function TestAbsFloat64(t *testing.T) { } ``` + Step2: Implement the `TestXxx` functions with some predefined values. + ``` func TestAbsFloat32(t *testing.T) { //Test values @@ -482,11 +492,14 @@ func TestAbsFloat64(t *testing.T) { } } ``` + Step3: Launch Test. Within the same directory as the test: + ``` go test ``` + This picks up any files matching packagename_test.go. If you are getting a `PASS`, you are passing the unit test. diff --git a/docs/en/MatrixOne/Contribution-Guide/make-your-first-contribution.md b/docs/en/MatrixOne/Contribution-Guide/make-your-first-contribution.md index 3c1cf2ee44aa2..7ed9109aa720d 100644 --- a/docs/en/MatrixOne/Contribution-Guide/make-your-first-contribution.md +++ b/docs/en/MatrixOne/Contribution-Guide/make-your-first-contribution.md @@ -1,9 +1,11 @@ # **Make Your First Contribution** + Thank you for your interest in contributing to MatrixOne. Contributions are welcome from everyone. This document will help you get started on your first contribution to MatrixOne. ## **How to Contribute?** + Before setting about contribution, you need figure out that in what area you can help us. You can see [Types of contributions](How-to-Contribute/types-of-contributions.md) for more details. As your first-ever contribution, it can be selected from the following categories, which require little technical background of the contributor: @@ -14,75 +16,100 @@ As your first-ever contribution, it can be selected from the following categorie File an issue to describe the problem before working on it. In addition, you will also find issues labelled with `good-first-issue`, which represents issues suitable for new contributors. Such Issues contain clear steps and expected output. You may start your first contribution based on these issues. - ## **Assign Your Issue** + It's difficult to report an issue when you are just a newcomer on account of little knowledge of MatrixOne or relative contents, so we list [`good-first-issues`](https://github.com/matrixorigin/matrixone/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) suitable for new contributors to work with and be easy to fix. After deciding a suitable issue to work on, you can comment `/assign` on the issue you would like to work on, you will be automatically assigned to the issue. You can then find yourself listed under Assignees section. ## **Prerequisite** + Before working on the issue you are assigned, please make sure you have set up development environment and installed MatrixOne. You can see [Preparation](How-to-Contribute/preparation.md) for more details. ## **Workflow** + ### **Step 1: Fork the Repository** + Visit our [Github Repository](https://github.com/matrixorigin/matrixone). On the top right of the page, click the Fork button (top right) to create a cloud-based fork of the repository. ![Fork our repo](https://github.com/matrixorigin/artwork/blob/main/docs/contribution-guide/contribution-guide-fork.png?raw=true) ### **Step 2: Clone fork to local storage** + Open the repository you forked from MatrixOne. Click on the Code button and then the Copy to Clipboard icon. ![Clone your fork](https://github.com/matrixorigin/artwork/blob/main/docs/contribution-guide/contribution-guide-clone.png?raw=true) Next, move to the working directory you expect in local and launch your terminal. Run the following Git command: + ``` git clone ``` + For example: + ``` git clone git@github.com:/matrixone.git ``` + `` is the ID you signed in at GitHub. This Git command downloads the content of MatrixOne repository you forked on GitHub to your local device. ### **Step 3: Add MatrixOne repo as a remote repository** + You can add MatrixOrigin/MatrixOne repository as a remote repository in local with: + ``` git remote add upstream https://github.com/matrixorigin/matrixone.git ``` + `upstream` is the designation of this remote repository. If you want to replace it with other words you want, don't forget to replace it as well in the next steps, or some errors will happen. ### **Step 4: Develop** + #### **Make some changes** + Now you can edit the code, modify the documents and make whatever changes you want about your issue, on the branch you just created. #### **Run MatrixOne in a standalone mode** + If you want to demonstrate whether the changes you made are valid or reproduce an issue, you need to run MatrixOne in a standalone mode. Before running, make sure you have installed MatrixOne according to our [Install tutorial](./../Get-Started/install-standalone-matrixone.md). And you can connect MatrixOne Serve according to the [Connect tutorial](./../Get-Started/connect-to-matrixone-server.md). - ### **Step 5: Commit to your local repo** + Having completed your modification, you can add the files you just modified using the `git add` command: + ``` git add ``` + `` is the name of the file you just modified. And you can use following command to add all the files in the current folder: + ``` git add . ``` + Next, you can commit these changes using the `git commit` command: + ``` git commit -m "" -s ``` + Summarize and describe your modification briefly in the place of ``. `-s` adds your sign-off message to your commit message. + ### **Step 6: Push to your remote repo** + After committing your modification, you should push your local branch to GitHub using the `git push` command, and we recommend you to push to a new branch: + ``` git push origin main:NEW_BRANCH ``` + `NEW_BRANCH` is the name of new branch you created and push to. Also, you can replace it with another name you want. ### **Step 7 Create a pull request** + Having pushed your changes, you can visit your folk at `https://github.com/$user/matrixone`, and click the **Compare & Pull Request** button to create a pull request in `NEW_BRANCH` for your modification to the MatrixOne repository. !!! Note @@ -94,13 +121,17 @@ Having pushed your changes, you can visit your folk at `https://github.com/$user Once your PR is opened, it will be assigned to reviewers. These reviewers will check your contribution and make a detail review, according to correctness, bugs, style and so on. ### **Step 8 After merging, Keep your repo in sync** + Congratulations on that your contributions are accepted and merged to the project! And there are some operations left to do, which helps keep project committing history clean and keep your local and remote repo synchronized with MatrixOne repo. Overrides local commiting history with following command: + ``` git pull --force upstream main:main ``` + Lastly, upgrade the `main` branch of your folk in Github: + ``` git push --force origin main:main ``` \ No newline at end of file diff --git a/docs/en/MatrixOne/Develop/develop_python_application.md b/docs/en/MatrixOne/Develop/develop_python_application.md index 22862f7846098..12a5800ff4fc6 100644 --- a/docs/en/MatrixOne/Develop/develop_python_application.md +++ b/docs/en/MatrixOne/Develop/develop_python_application.md @@ -33,8 +33,6 @@ pip3 install -r requirements.txt !!! info `Pymysql` is the only ORM tool supported by MatrixOne. The other python MySQL ORM tools as `SQLAlchemy`, `mysql-connector`, `MySQLdb` are not supported yet. - - ## **Step1: prepare and load historical dataset** At first, we need to load the historical stock data in MatrixOne. @@ -62,7 +60,6 @@ pool = pro.stock_basic(exchange = '', As we only need the P/E and P/B information, we call the `daily_basic` method and get each stock with data frames with `ts_code`, `trade_date`, `pe` and `pb` fields. Without any specification of start date and end date, `Tushare` will automatically output 5000 lastest records. - ```python j = 1 @@ -130,7 +127,6 @@ if df.empty == False: ``` - ## **Step2: find the historical lowest P/E or P/B stock** After we load the historical stock data into MatrixOne, we have about 11 millions records. diff --git a/docs/en/MatrixOne/FAQs/general-faqs.md b/docs/en/MatrixOne/FAQs/general-faqs.md index d5f127f285cec..f12a4d18e9d03 100644 --- a/docs/en/MatrixOne/FAQs/general-faqs.md +++ b/docs/en/MatrixOne/FAQs/general-faqs.md @@ -54,6 +54,7 @@
## **Deployment FAQs** + * Are there any hardware requirements for deploying MatrixOne? Standalone setting specification: x86 CPU with 4 cores and 32GB memory, with CentOS 7+ Operating System. @@ -68,7 +69,6 @@ No, they are not case sensitive.
- * **How do I export data from MatrixOne to a file?** You can use `SELECT INTO OUTFILE` command to export data from MatrixOne to a **csv** file (only to the server host, not to the remote client). diff --git a/docs/en/MatrixOne/Get-Started/Playground.md b/docs/en/MatrixOne/Get-Started/Playground.md index b55396f7309f3..8aa9b3ed83284 100644 --- a/docs/en/MatrixOne/Get-Started/Playground.md +++ b/docs/en/MatrixOne/Get-Started/Playground.md @@ -1,4 +1,5 @@ # **Playground** + [MatrixOne Playground](https://playground.matrixorigin.io/?tutorial=SSB-test-with-matrixone&step=1) allows you to try SQL statements and explore features of MatrixOne instantly from your web browser with interactive tutorials. * For docs about our SQL commands, you can see [SQL Reference](../Reference/SQL-Reference/Data-Definition-Statements/create-database.md). @@ -12,13 +13,14 @@ You can only operate in **read-only** mode in MatixOrigin Playground,so DDL co ```create/drop table``` , ```truncate``` , ```update``` , ```set``` ,```use``` * Part of **DML** commands are not available: -```insert``` , ```replace``` , ```delete```,```select into ``` +```insert``` , ```replace``` , ```delete```,```select into``` * ```commit``` is not available * ```call``` is not available * **max_result_rows**=2000 + ## **Examples** In Playground, You can follow different interactive tutorials and pick one in the list box, and now the supported tutorials are shown below: @@ -26,7 +28,8 @@ In Playground, You can follow different interactive tutorials and pick one in th * [**SSB Test with MatrixOne**](https://playground.matrixorigin.io/?tutorial=SSB-test-with-matrixone&step=1) We will use **SSB Test** as an example to show you the overall operation process of Playground. -### ** Test Preperations** + +### **Test Preperations** This tutorial walks you through the most popular **Star Schema Benchmark(SSB)**Test SQL statements with MatrixOne. To better experience MatrixOne features and performance, test queries in this tutorial will run without filters. Before you started, the test datasets have been pre-loaded in database `ssb`. To list available tables in the database you can query : @@ -40,9 +43,8 @@ SHOW TABLES; The query results are displayed in the lower right. Then you can run the queries on SSB datasets, click **Continue**. - - ### **Run Query Command** + Now, You can query the table with SQL commands we provide. For example: @@ -52,6 +54,7 @@ For example: select sum(lo_revenue) as revenue from lineorder join dates on lo_orderdate = d_datekey; ``` + And you can use ```join``` in queries: * **Run Q1.2 query** @@ -61,6 +64,7 @@ select sum(lo_revenue) as revenue from lineorder join dates on lo_orderdate = d_datekey; ``` + Additionally, ```group by``` and ```order by``` can be used: * **Run Q2.1 query** @@ -74,9 +78,11 @@ join supplier on lo_suppkey = s_suppkey group by d_year, p_brand order by d_year, p_brand; ``` + More query commands are provided in **Playground**, you can test on your own. ## **Learn More** + This page describes the features, limitations, and examples of Playground. For information on other options that are available when trying out MatrixOne, see the following: * [Install MatrixOne](install-standalone-matrixone.md) diff --git a/docs/en/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md b/docs/en/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md index f92010db7f88a..7dd9bb52a365c 100644 --- a/docs/en/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md +++ b/docs/en/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md @@ -14,8 +14,8 @@ For detail description and instructions for downloading about **NYC Taxi Data**, Make sure you have already [installed MatrixOne](../install-standalone-matrixone.md) and [connected to MatrixOne Server](../connect-to-matrixone-server.md). - ## **1. Download and Import data** + This section of the tutorial references [here](https://github.com/toddwschneider/nyc-taxi-data), and you can get original information about how to download and import raw data there. The data set has 1.7 billion rows data and takes up 450 GB of space, so make sure there are enough space to hold the data. @@ -29,6 +29,7 @@ Both are available via [Homebrew](https://brew.sh) on Mac. ``` ./download_raw_data.sh && ./remove_bad_rows.sh ``` + The remove_bad_rows.sh script fixes two particular files that have a few rows with too many columns. For more detailed information about this, you can see the original references. @@ -54,7 +55,6 @@ The FiveThirtyEight Uber dataset contains Uber trip records from Apr–Sep 2014. ./import_2014_uber_trip_data.sh ``` - ## **2. Exporting the data from PostgreSQL** ``` @@ -128,8 +128,8 @@ COPY ) TO '/matrixone/export_data/trips.tsv'; ``` - ## **3. Create tables in MatrixOne** + ``` CREATE TABLE trips ( @@ -194,7 +194,6 @@ CREATE TABLE trips load data infile '/matrixone/export_data/trips.tsv ' into table trips FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; ``` - Then you can query data in MatrixOne with the created table. ## **5. Run Queries** diff --git a/docs/en/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md b/docs/en/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md index 6f07aa3a97a3e..c3df156d4c6d3 100644 --- a/docs/en/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md +++ b/docs/en/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md @@ -8,7 +8,6 @@ In v0.1.0, only single table can work in MatrixOne. The following contents can b Make sure you have already [installed MatrixOne](../install-standalone-matrixone.md) and [connected to MatrixOne Server](../connect-to-matrixone-server.md). - ## **1. Compile dbgen** ``` @@ -29,7 +28,6 @@ $ ./dbgen -s 1 -T s $ ./dbgen -s 1 -T d ``` - ## **3. Create tables in MatrixOne** ``` @@ -157,10 +155,10 @@ CREATE TABLE lineorder_flat( ); ``` - ## **4. Load data into the created tables** Modify the parameter of system_vars_config.toml to a larger one in matrixone directory, such as 10GB. And restart MatrixOne service. + ``` max-entry-bytes = "10GB" ``` @@ -181,7 +179,7 @@ load data infile '/ssb-dbgen-path/lineorder.tbl' into table lineorder FIELDS TER Then you can query data in MatrixOne with the created table. If you want to run a single table SSB query test, there is still one more data files needed for lineorder_flat. You can get the data files directly: -> https://community-shared-data-1308875761.cos.ap-beijing.myqcloud.com/lineorder_flat.tar.bz2 +> Load data into lineorder_flat. @@ -192,6 +190,7 @@ load data infile '/ssb-dbgen-path/lineorder_flat.tbl ' into table lineorder_flat ## **5. Run SSB Queries** ### **Flat table queries** + ```sql --Q1.1 SELECT sum(LO_EXTENDEDPRICE * LO_DISCOUNT) AS revenue FROM lineorder_flat WHERE year(LO_ORDERDATE)=1993 AND LO_DISCOUNT BETWEEN 1 AND 3 AND LO_QUANTITY < 25; diff --git a/docs/en/MatrixOne/Get-Started/install-distributed-matrixone.md b/docs/en/MatrixOne/Get-Started/install-distributed-matrixone.md index 94e1f7972f571..819472583d98f 100644 --- a/docs/en/MatrixOne/Get-Started/install-distributed-matrixone.md +++ b/docs/en/MatrixOne/Get-Started/install-distributed-matrixone.md @@ -3,42 +3,47 @@ MatrixOne supports distributed deloyment. At least 3 stores (same as Nodes) are required for the distributed setting. ### Two Types of Stores + There are two types of stores in a MatrixOne cluster: prophet stores and pure storage stores. The first three stores are prophet stores. The others are pure storage stores. For example, if there're three stores in the cluster, all the stores are prophet stores. If there're five nodes in the cluster, three are prophet stores, two are pure storage stores. - ### Installation This tutorial is an example of 5 stores installation. -#### *Step1*: +#### *Step1* Prepare 3 servers as prophet stores (recommended specification: x86 CPU with 16 cores and 64GB memory, with CentOS 7+ OS). Each store must install a MatrixOne as standalone version. Installation steps are the same as [the standalone](install-standalone-matrixone.md). -#### *Step2*: +#### *Step2* Set up store1, which is also called the `Prophet Genesis Store`. 1. Set `id` of the Prophet Genesis Store: + ``` nodeID = 1 ``` + 2. Set `addr-raft` and `addr-client` to receive Raft protocol and `Shard Proxy` messages from other MatrixCube stores: + ``` addr-raft = "your_ip_address:10000" addr-client = "your_ip_address:20000" ``` 3. Set the size limit of a `Shard`: + ``` shard-capacity-bytes = "4096MB" ``` 4. Set `rpc-addr` to receive heartbeats from the whole cluster: + ``` rpc-addr = "your_ip_address:30000" ``` @@ -50,29 +55,36 @@ join = "" client-urls = "your_ip_address:40000" peer-urls = "your_ip_address:50000" ``` + 6. Set `prophet-node` to TRUE, as the prophet store will hold the cluster metadata: + ``` prophet-node = true ``` + 7. Set `max-replicas` number to the replica numbers that you want, it can only be `2*N+1` numbers: + ``` max-replicas = 3 ``` -#### *Step3*: +#### *Step3* Set up store2 and store3 as prophet stores. Repeat the same procedure of step1 and step2 for each store. The only two differences are setting a unique `nodeID` and a `join` ip address. + ``` nodeID = 2 or 3; join = "ip_address_of_store1" ``` -#### *Step4*: +#### *Step4* Set up the other two stores as pure storage store. Repeat the same procedure of step1 and step2 for each store. There are three more parameters to be set: + * Set a unique number for nodeID. * Set `prophet-node` to TRUE. * Fill the three empty string with the three client-urls of the three prophet node for the `external-etcd` parameter. + ``` nodeID = 4/5; prophet-node = false; diff --git a/docs/en/MatrixOne/Get-Started/install-standalone-matrixone.md b/docs/en/MatrixOne/Get-Started/install-standalone-matrixone.md index 74e4307681675..7c9a2c0a06cba 100644 --- a/docs/en/MatrixOne/Get-Started/install-standalone-matrixone.md +++ b/docs/en/MatrixOne/Get-Started/install-standalone-matrixone.md @@ -18,10 +18,8 @@ $ makepkg -rsi #### 1. Install Go as necessary - Go version 1.18 is required. - #### 2. Get the MatrixOne code ``` @@ -51,12 +49,14 @@ Starting with 0.3.0, you can download binary packages directly to run MatrixOne #### 1. Download binary packages and decompress Linux Environment + ```bash $ wget https://github.com/matrixorigin/matrixone/releases/download/v0.4.0/mo-server-v0.4.0-linux-amd64.zip $ unzip mo-server-v0.4.0-linux-amd64.zip ``` MacOS Environment + ```bash $ https://github.com/matrixorigin/matrixone/releases/download/v0.4.0/mo-server-v0.4.0-darwin-x86_64.zip $ unzip mo-server-v0.4.0-darwin-x86_64.zip @@ -68,16 +68,18 @@ $ unzip mo-server-v0.4.0-darwin-x86_64.zip $./mo-server system_vars_config.toml ``` - ## **Using docker** #### 1. Install Docker + Please verify that Docker daemon is running in the background: ``` $ docker --version ``` + #### 2. Create and run the container for the latest release of MatrixOne + It will pull the image from Docker Hub if not exists. ``` diff --git a/docs/en/MatrixOne/Overview/MatrixOne-Tech-Design/matrixone-techdesign.md b/docs/en/MatrixOne/Overview/MatrixOne-Tech-Design/matrixone-techdesign.md index 54fdbae96a2a6..ad65628019848 100644 --- a/docs/en/MatrixOne/Overview/MatrixOne-Tech-Design/matrixone-techdesign.md +++ b/docs/en/MatrixOne/Overview/MatrixOne-Tech-Design/matrixone-techdesign.md @@ -3,22 +3,25 @@ In [MatrixOne Introduction](../matrixone-introduction.md) we have introduced the key features and core concepts of MatrixOne and in [MatrixOne Architecture](../matrixone-architecture.md) we show you the overall architecture of MatrixOne. This chapter will unfold the architecture and explain about the tech design. -## **MatrixOne Architectural Features ** +## **MatrixOne Architectural Features** + The current design of MatrixOne is a combination of NewSQL and MPP, and we call it an HTAP DBMS with OLAP enhancement. **Simplicity** is the most important design principle for both usage, deployment and maintenance. Despite being a distributed database, MatrixOne only provides a single binary for deployment, with each node running exactly the same single process. ### **NewSQL** + As we all know, relational database has existed for more than 30 years with `relational model`, `SQL` and `transaction processing`, until recently NewSQL emerged. NewSQL refers to a distributed architecture, starting with Google Spanner, using **Replicate State Machine** as the core, to solve the scalability and high availability problems of traditional standalone relational databases. Replicate State Machine is the main method to implement fault-tolerant services. The state machine starts at a given initial state, and each input received is used by a state transition mechanism to generate a new state and corresponding output. In replicate state machines, the state machines of a set of servers compute copies of the same state and can continue to run even if a portion of the servers go down. In the context of replicate state machines, consistency protocols are proposed to ensure the consistency of replicate logs. Common consistency protocols include Paxos and Raft. -In the architecturet of replicate state machine, OLTP capability is realized by mounting the Key Value storage engine, which is the main design of NewSQL. +In the architecture of replicate state machine, OLTP capability is realized by mounting the Key Value storage engine, which is the main design of NewSQL. The biggest difference between MatrixOne's design and other NewSQL databases is that the former one can mount various storage engines. In the 0.2 version, the Key-Value storage engine is mounted to store `Catalog` and other metadata and a column storage engine is mounted to provide OLAP capability. In fact, any storage engine can be mounted including but not limited to row storage, graph, time series, dedicated NoSQL and other multimodal engines. Different storage engines can be adapted for different scenarios. We welcome community developers to contribute ideas and code to this part. ![Replicate state machine implementation for Raft](https://github.com/matrixorigin/artwork/blob/main/docs/overview/consensus-modules.png?raw=true) ### **MPP** + MPP(Massively Parallel Processing) is a computing architecture that is used to analyze large-scale data. In simple terms, MPP is to distribute tasks to multiple servers and nodes in parallel. After the computation is completed on each node, the results of each part are aggregated together to obtain the final result. This architecture was adopted by first-generation OLAP databases such as Teradata and Greenplum. MapReduce, the key component for Hadoop, also borrowed from the MPP architecture. However, between Hadoop and MPP OLAP databases, differences are obvious in the amount of data processed, SQL support, data processing types and efficiency. Hadoop is more like a data lake, which can store and process hundreds of PB data, define schema when reading, and store a large amount of unstructured and semi-structured data. However, SQL support, query performance and real-time streaming processing are not ideal. A database solution based on the MPP architecture is more like a relational database with substantially enhanced query capabilities, still with good SQL support and ACID transaction properties. The latest generation of open-source MPP compute engines includes: Clickhouse, Presto, Impala, SparkSQL, Apache Doris, etc. @@ -27,24 +30,31 @@ MatrixOne also provides great OLAP performance based on the MPP architecture. Bu ![MPP architecture](https://github.com/matrixorigin/artwork/blob/main/docs/overview/mpp_architecture.png?raw=true) ## **MatrixOne's Designed Modules and Current Progress** + MatrixOne is divided into **SQL Frontend**, **Computing Layer**, **Metadata Layer**, **Distributed Framework** and **Storage Layer**. ![MatrixOne Modules](https://github.com/matrixorigin/artwork/blob/main/docs/overview/matrixone-modules.png?raw=true) #### *SQL Frontend* + The entry of the MatrixOne. Currently MatrixOne provides MySQL compatibility protocol and support part of MySQL dialact. SQL Frontend receives requests from MySQL clients and pass to next layer after parsing them. Learn more about MatrixOne [MySQL Compatibility](../mysql-compatibility.md) #### *SQL Parser in Computing Layer* + After receiving a request from the SQL Frontend, SQL Parser parses it and transforms it into an abstract syntax tree(AST). MatrixOne doesn't use the popular open-source query parser, such as TiDB, Vitess parser, etc. In fact, TiDB parser was used in MatrixOne version 0.1, but we developed a new parser for version 0.2, mainly because: + * MatrixOne intends to create a hyperconverged database where lots of custom syntax not necessarily consistent to MySQL. * Currently, MatrixOne enhances more OLAP capabilities, whereas the current open-source parser is basically designed for OLTP scenarios, and has high performance overhead for some OLAP scenarios, such as mass insertion. * MatrixOne also plans to offer multi-dialect protocol compatibility in the future, including PostgreSQL, Hive, ClickHouse and so on. Therefore, MatrixOne needs to own its own Query Parser, which can be customized arbitrarily, and provides the basis for multi-dialect syntactic compatibility. #### *MPP SQL Execution in Computing Layer* + This part is the MPP compute engine established by Golang. MatrixOne compute engine accelerates SQL excutions by vectorization acceleration. The vectorization is achieved by leveraging hardware features. At present, only the adaptation and acceleration of AVX2 and AVX512 instruction sets in Intel X86 architecture are realized. More hardware platform support for accleration can be an interesting subject for community participations. Another important design in compute engine is factorization, which breaks down the complex SQL join into an linear polynomial calculation, and significantly reduces the time consumed for complex join. + #### *Catalog as Metadata Layer* + It's the component that holds the overall metadata of the database, such as Table/Schema definitions. Currently, Catalog is still a temporary solution using Key-Value engine, and the subsequent Catalog will be migrated to a standard OLTP engine, providing further and more complete ACID capability to support the Catalog component. #### *MatrixCube as Distributed Framework* @@ -66,8 +76,6 @@ Please refer to [AOE Technical Design](https://github.com/matrixorigin/matrixone Another **TPE(Transaction Processing Engine)** is under development. TPE is designed to support `catalog` usage, for now, it will not provide transactional service for the external users. In the future, it's possible that TPE provides complete SQL capabilities externally. - - ## **Learn More** If you are interested in a particular module and would like to contribute, please refer to [contribution guide](../../Contribution-Guide/How-to-Contribute/preparation.md) to check out MatrixOne codebase structure. diff --git a/docs/en/MatrixOne/Overview/NYC Test Performance.md b/docs/en/MatrixOne/Overview/NYC Test Performance.md index f3571a129a136..0bd4a000a79fb 100644 --- a/docs/en/MatrixOne/Overview/NYC Test Performance.md +++ b/docs/en/MatrixOne/Overview/NYC Test Performance.md @@ -1,13 +1,12 @@ # **NYC Test Performance** ## **Overview** -With MatrixOne v0.2.0, we follow the [Tutorial](../Get-Started/Tutorial/NYC-test-with-matrixone.md) to execute **NYC Taxi** test with a standalone server, and compare the results with that of other products, which shows the performance of MatrixOne in query processing time. +With MatrixOne v0.2.0, we follow the [Tutorial](../Get-Started/Tutorial/NYC-test-with-matrixone.md) to execute **NYC Taxi** test with a standalone server, and compare the results with that of other products, which shows the performance of MatrixOne in query processing time. !!! note "note" The following test results are the average of the three tests in seconds. - ## **Standalone node** !!! info @@ -25,12 +24,14 @@ With MatrixOne v0.2.0, we follow the [Tutorial](../Get-Started/Tutorial/NYC-test ![柱状图](https://github.com/matrixorigin/artwork/blob/main/docs/overview/NYC_standalone.png?raw=true) ## **Limitations** -There are some limitations on quiries in MatrixOne v0.2.0: -* The filter command `WHERE` is not surpported -* The table cannot be partitioned currently, so commands as `PARTITION` series are not surpported +There are some limitations on queries in MatrixOne v0.2.0: + +* The filter command `WHERE` is not supported +* The table cannot be partitioned currently, so commands as `PARTITION` series are not supported ## **Learn More** + This page shows the results of NYC Test with MatrixOne. For information on other benchmarks that are available when trying out MatrixOne, see the following: * [SSB Test with MatrixOne](../Get-Started/Tutorial/SSB-test-with-matrixone.md) diff --git a/docs/en/MatrixOne/Overview/SSB Test Performance.md b/docs/en/MatrixOne/Overview/SSB Test Performance.md index ac0d6f441d41d..2cb86035f3d7e 100644 --- a/docs/en/MatrixOne/Overview/SSB Test Performance.md +++ b/docs/en/MatrixOne/Overview/SSB Test Performance.md @@ -1,6 +1,7 @@ # **SSB Test Performance** ## **Overview** + We present the **SSB Test** results for MatrixOne with different hardwares and query modes. For instructions to reproduce the SSB test results listed here, see [SSB Test with MatrixOne](../Get-Started/Tutorial/SSB-test-with-matrixone.md), and if you fail to achieve similar results, there is likely a problem in either the hardware, workload, or test design. @@ -12,11 +13,10 @@ Recommended server specification: x86 CPU with 16 cores and 64GB memory, with Ce !!! note "note" The following test results are the average of the three tests in seconds. - In order to show the single-table query performance, we combine five tables into a flat table called `lineorder_flat`. - ## **Standalone node&Single table** + We use standalone service to execute flat table(`lineorder_flat`) queries with MatrixOne, and compared the results with ClickHouse in the same configuration. The table `lineorder_flat` has 600 million rows data and takes up 220 GB of space. @@ -24,8 +24,6 @@ The table `lineorder_flat` has 600 million rows data and takes up 220 GB of spac The following server was used: AMD EPYC™ Rome CPU 2.6GHz/3.3GHz, 16 physical cores total, 32 GiB Memory. - - | Query ID | MatrixOne v0.2.0 | ClickHouse v21.11.4.14 | :----: | :----: | :----: | Q2 | 2.71 |3.82 @@ -39,6 +37,7 @@ The table `lineorder_flat` has 600 million rows data and takes up 220 GB of spac ![柱状图](https://github.com/matrixorigin/artwork/blob/main/docs/overview/SSB_standalone_single.png?raw=true) ## **Standalone node&Multiple tables** + With a standalone server again, now we execute multiple tables queries on the original tables of SSB Test. There are 600 million rows of data in all, and the main table takes up 67 GB of space. @@ -53,6 +52,7 @@ There are 600 million rows of data in all, and the main table takes up 67 GB of | SUM | 129.85|265.71|136.37 ![柱状图](https://github.com/matrixorigin/artwork/blob/main/docs/overview/SSB_standalone_multi.png?raw=true) + ## **Cluster&Multiple tables** There are three nodes in the cluster, each of which is installed as standalone version, and process time is shorter than that of standclone node, demonstrating the overall performance will improve as the number of nodes increases. @@ -70,12 +70,14 @@ There are three nodes in the cluster, each of which is installed as standalone v ![柱状图](https://github.com/matrixorigin/artwork/blob/main/docs/overview/SSB_cluster_multi.png?raw=true) ## **Limitations** -We didn't finished all the quiries of SSB Test in MatrixOne v0.2.0 because: -* The filter command `WHERE` is not surpported -* The table cannot be partitioned currently, so commands as `PARTITION` series are not surpported +We didn't finished all the queries of SSB Test in MatrixOne v0.2.0 because: + +* The filter command `WHERE` is not supported +* The table cannot be partitioned currently, so commands as `PARTITION` series are not supported ## **Learn More** + This page shows the results of SSB Test with MatrixOne. For information on other benchmarks that are available when trying out MatrixOne, see the following: * [NYC Test with MatrixOne](../Get-Started/Tutorial/NYC-test-with-matrixone.md) diff --git a/docs/en/MatrixOne/Overview/matrixcube/matrixcube-auto-rebalance-scheduling.md b/docs/en/MatrixOne/Overview/matrixcube/matrixcube-auto-rebalance-scheduling.md index 36baa688deee7..41fae0ebdfbcb 100644 --- a/docs/en/MatrixOne/Overview/matrixcube/matrixcube-auto-rebalance-scheduling.md +++ b/docs/en/MatrixOne/Overview/matrixcube/matrixcube-auto-rebalance-scheduling.md @@ -38,4 +38,3 @@ For each `Shard`, it has several `Replicas` distributed in several `Stores`. The ## **Event Notify** The `Heartbeat` information collected will be synchronized to all MatrixCube `Stores`. Each `Store` will form the global routing table. - diff --git a/docs/en/MatrixOne/Overview/matrixcube/matrixcube-introduction.md b/docs/en/MatrixOne/Overview/matrixcube/matrixcube-introduction.md index f9f6d0f5790db..c2039e80aa1d0 100644 --- a/docs/en/MatrixOne/Overview/matrixcube/matrixcube-introduction.md +++ b/docs/en/MatrixOne/Overview/matrixcube/matrixcube-introduction.md @@ -4,14 +4,10 @@ MatrixCube is a fundamental library for building distributed systems, which offe Unlike many other distributed systems, MatrixCube is designed as part of the storage nodes. A matrixone distributed deployment doesn't not have dedicated scheduling nodes. MatrixCube cannot work as a standalone module. - ## **MatrixCube Architecture** - ![Matrix Cube](https://github.com/matrixorigin/artwork/blob/main/docs/overview/matrixcube-architecture.svg?raw=true) - - ## **Key Concepts** There are several key concepts for understanding how MatrixCube works. @@ -60,11 +56,6 @@ Learn more about [How does Prophet handle the scheduling?](matrixcube-auto-rebal Learn more about [How do the `Shard Proxy` and `Global Routing` work?](matrixcube-proxy-routing.md) - - - - - ## **Key Features** ### **Strong Consistency** @@ -77,7 +68,6 @@ The distributed storage service implemented by MatrixCube is a fault tolerant an For example, a cluster with 3 `Stores` can survive with 1 `Store` failure; a cluster with 5 `Stores` can survive with 2 `Stores` failure. - ### **Shard Splitting** There is a certain limit to a `Shard` size. Whenever a `Shard` exceeds its storage limit, MatrixCube splits a `Shard` into two `Shards` and keep each `Shard` with the same storage level. @@ -101,8 +91,3 @@ MatrixCube has no limit to standalone data storage engine. Any storage engine im ### **User-defined Read/Write** As a general distributed framework, different distributed storage system could be build based on MatrixCube. User can also customize their read/write commands. As long as it works in a standalone version, MatrixCube can help you upgrading it to a distributed version. - - - - - diff --git a/docs/en/MatrixOne/Overview/matrixcube/matrixcube-proxy-routing.md b/docs/en/MatrixOne/Overview/matrixcube/matrixcube-proxy-routing.md index b2c550db8b671..7f340c4882f6e 100644 --- a/docs/en/MatrixOne/Overview/matrixcube/matrixcube-proxy-routing.md +++ b/docs/en/MatrixOne/Overview/matrixcube/matrixcube-proxy-routing.md @@ -9,12 +9,12 @@ A user can send this request to any `Store` of the system. The `Shard Proxy` of As we have explained in the `Raft Group and Leader`,`Leader` is the representative of a `Raft Group`, all read and write requests are handled only by the leader. Therefore, when a request for certain rows are executed. + * Firstly, we need to locate the `Shard` where these rows are stored. * Secondly, locate the `Leader Replica` of this `Shard` group. * Thirdly, route the request to the `Store` where the `Leader Replica` is located. * Finally, `Leader Replica` executes the request and returns response. - ## **Example** We have a cluster of 3 `Stores`, and their status are as below: @@ -28,4 +28,3 @@ We have a cluster of 3 `Stores`, and their status are as below: A user sends requests on key1, key10 and key20, the following diagram illustrates how the requests gets through `Shard Proxy` and being routed. ![User Request Routing Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/overview/matrixcube-requests.svg?raw=true) - diff --git a/docs/en/MatrixOne/Overview/matrixcube/matrixcube-shard-splitting.md b/docs/en/MatrixOne/Overview/matrixcube/matrixcube-shard-splitting.md index 63f43201d9222..9f7f11d13b567 100644 --- a/docs/en/MatrixOne/Overview/matrixcube/matrixcube-shard-splitting.md +++ b/docs/en/MatrixOne/Overview/matrixcube/matrixcube-shard-splitting.md @@ -11,4 +11,3 @@ Once two new `Raft-Groups` are created, a re-election will immediately be hold. The belowing diagram illustrates how the shard splitting works: ![Shard Splitting](https://github.com/matrixorigin/artwork/blob/main/docs/overview/matrixcube-shard-splitting.svg?raw=true) - diff --git a/docs/en/MatrixOne/Overview/matrixone-architecture.md b/docs/en/MatrixOne/Overview/matrixone-architecture.md index 5be28d7893879..953cea3f255ed 100644 --- a/docs/en/MatrixOne/Overview/matrixone-architecture.md +++ b/docs/en/MatrixOne/Overview/matrixone-architecture.md @@ -1,20 +1,24 @@ # **MatrixOne Architecture** ## **Architecture** + MatrixOne is totally redesigned. It consists of multiple components and form a complete system. The architecture is as follows: ![MatrixOne Architecture](https://github.com/matrixorigin/artwork/blob/main/docs/overview/overall-architecture.png?raw=true) ## **Query Parser Layer** + * **Parser:** Parses SQL, Streaming Query, or Python language into an abstract syntax tree for further processing. * **Planner:** Finds the best execution plan through rule-based, cost-based optimization algorithms, and transfers abstract syntax tree to plan tree. * **IR Generator:** Converts Python code into an intermediate representation. ## **Computation Layer** + * **JIT Compilation:** Turns SQL plan tree or IR code into a native program using LLVM at runtime. * **Vectorized Execution:** MatrixOne leverages SIMD instructions to construct vectorized execution pipelines. * **Cache:** Multi-version cache of data, indexes, and metadata for queries. ## **Cluster Management Layer (MatrixCube)** + MatrixCube is a fundamental library for building distributed systems, which offers guarantees about reliability, consistency, and scalability. It is designed to facilitate distributed, stateful application building to allow developers only need to focus on the business logic on a single node. MatrixCube is currently built upon multi-raft to provide replicated state machine and will migrate to Paxos families to increase friendliness to scenarios spanning multiple data centers. * **Prophet:** Used by MatrixCube to manage and schedule the MatrixOne cluster. @@ -28,13 +32,13 @@ MatrixCube is a fundamental library for building distributed systems, which offe ## **Storage Provision Layer** -As an infrastructure agnostic DBMS, MtrixOne stores data in shared storage of S3 / HDFS, or the local disk, on-premise server, hybrid and any cloud, or even smart devices. - +As an infrastructure agnostic DBMS, MatrixOne stores data in shared storage of S3 / HDFS, or the local disk, on-premise server, hybrid and any cloud, or even smart devices. ## **Learn More** + This page outlines the overall architecture design of MatrixOne. For information on other options that are available when trying out MatrixOne, see the following: * [MatrixOne Tech Design](MatrixOne-Tech-Design/matrixone-techdesign.md) * [Install MatrixOne](../Get-Started/install-standalone-matrixone.md) * [MySQL Compatibility](mysql-compatibility.md) -* [What‘s New](whats-new.md) \ No newline at end of file +* [What's New](whats-new.md) \ No newline at end of file diff --git a/docs/en/MatrixOne/Overview/matrixone-introduction.md b/docs/en/MatrixOne/Overview/matrixone-introduction.md index 0ee412eedc73c..aeb41040e7d68 100644 --- a/docs/en/MatrixOne/Overview/matrixone-introduction.md +++ b/docs/en/MatrixOne/Overview/matrixone-introduction.md @@ -3,8 +3,10 @@ MatrixOne is a future-oriented hyperconverged cloud & edge native DBMS that supports transactional, analytical, and streaming workload with a simplified and distributed database engine, across multiple datacenters, clouds, edges and other heterogenous infrastructures. ## **Key Features** + ### **Hyperconverged Engine** -* **Monolitic Engine** + +* **Monolithic Engine** A monolithic database engine is designed to support hybrid workloads: transactional, analytical, streaming, time-series, machine learning, etc. @@ -13,6 +15,7 @@ MatrixOne is a future-oriented hyperconverged cloud & edge native DBMS that supp With the built-in streaming engine, MatrixOne supports in-database streaming processing by groundbreaking incremental materialized view maintenance. ### **Cloud & Edge Native** + * **Real Infrastructure Agnostic** MatrixOne supports seemless workload migration and bursting among different locations and infrastructures. @@ -22,6 +25,7 @@ MatrixOne is a future-oriented hyperconverged cloud & edge native DBMS that supp MatrixOne provides industry-leading latency control with optimized consistency protocol. ### **Extreme Performance** + * **High Performance** Accelerated queries supported by patented vectorized execution as well as optimal computation push down strategies through factorization techniques. @@ -35,6 +39,7 @@ MatrixOne is a future-oriented hyperconverged cloud & edge native DBMS that supp Seamless and non-disruptive scaling by disaggregated storage and compute. ## **User Values** + * **Simplify Database Management and Maintenance** To solve the problem of high and unpredictable cost of database selection process, management & maintenance due to database overabundance, MatrixOne all-in-one architecture will significantly simplify database management and maintenance, single database can serve multiple data applications. @@ -53,13 +58,14 @@ MatrixOne is a future-oriented hyperconverged cloud & edge native DBMS that supp * **An Solid OLTP-like OLAP Experience** - Current data warehousing solutions have the following problems such as high latency and absense of immediate visibility for data updates. MatrixOne brings OLTP (Online Transactional Processing) level consistency and high availability to CRUD operations in OLAP (Online Analytical Processing). + Current data warehousing solutions have the following problems such as high latency and absence of immediate visibility for data updates. MatrixOne brings OLTP (Online Transactional Processing) level consistency and high availability to CRUD operations in OLAP (Online Analytical Processing). * **Seamless and Non-disruptive Scaling** It is difficult to balance performance and scalability to achieve optimum price-performance ratio in current data warehousing solutions. MatrixOne's disaggregated storage and compute architecture makes it fully automated and efficient scale in/out and up/down without disrupting applications. ## **Learn More** + This page outlines the overall introduction of MatrixOne. For information on other options that are available when you what to know more about MatrixOne product design, see the following: * [MatrixOne Architecture](matrixone-architecture.md) diff --git a/docs/en/MatrixOne/Overview/mysql-compatibility.md b/docs/en/MatrixOne/Overview/mysql-compatibility.md index 12cc7ca4747dc..1755d5fd69007 100644 --- a/docs/en/MatrixOne/Overview/mysql-compatibility.md +++ b/docs/en/MatrixOne/Overview/mysql-compatibility.md @@ -2,14 +2,12 @@ MatrixOne SQL syntax conforms with MySQL 8.0.23 version. - - | SQL Type | SQL Syntax | Compability with MySQL8.0.23 | | ---- | ---- | ---- | | DDL | CREATE DATABASE | A database with Chinese name will be displayed incorrectly. | | | | Names with Latins support limitedly. | | | | ENCRYPTION can be used but doesn't work till now. | -| | CREATE TABLE | Temporary tables are not supported seperatedly. | +| | CREATE TABLE | Temporary tables are not supported separately. | | | | Partition tables are not supported. | | | | Create table .. as clause is not supported now. | | | | All column level constraints are not supported now. | @@ -38,8 +36,8 @@ MatrixOne SQL syntax conforms with MySQL 8.0.23 version. | | | For clause is not supported now. | | | | INTO OUTFILE is limitedly support. | | | LOAD DATA | Only csv files can be loaded currently. | -| | | The enclosed character shoud be "". | -| | | FILEDS TERMINATED BY should be "," or "|". | +| | | The enclosed character should be "". | +| | | FIELDS TERMINATED BY should be "," or "|". | | | | LINES TERMINATED BY should be "\n". | | | | SET is not supported now. | | | | Local key word is not supported now. | @@ -53,11 +51,11 @@ MatrixOne SQL syntax conforms with MySQL 8.0.23 version. | | Other statements | Not supported now. | | Data Types | Int/Bigint/Smallint/Tinyint | Same as MySQL. | | | char/varchar | Same as MySQL. | -| | Float/double | The precsion is a bit different with MySQL. It will be adjusted in future release. | +| | Float/double | The precision is a bit different with MySQL. It will be adjusted in future release. | | | Date | Only 'YYYY-MM-DD' and 'YYYYMMDD' formats are supported. | | | Datetime | Only 'YYYY-MM-DD HH:MM:SS' and 'YYYYMMDD HH:MM:SS' formats are supported. | | | Other types | Not supported now. | -| Operatiors | "+","-","*","/" | Same as MySQL. | +| Operators | "+","-","*","/" | Same as MySQL. | | | DIV, %, MOD | Not supported now. | | | LIKE | Supported with constraints. | | | IN | Supported for constant lists | @@ -65,9 +63,3 @@ MatrixOne SQL syntax conforms with MySQL 8.0.23 version. | | XOR | Not supported now. | | | MAX, MIN, COUNT, AVG | Same as MySQL. | | | CAST | Supported limitedly. | - - - - - - diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/date.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/date.md index 8e8b9cc502886..3fa80aeb28782 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/date.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/date.md @@ -4,22 +4,20 @@ Extracts the date part of the date or datetime expression expr. - ## **Syntax** ``` > DATE(expr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | Required. The date/datetime to extract the date from. | - - ## **Examples** - ```sql > drop table if exists t1; > create table t1(a date, b datetime); diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/dayofyear.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/dayofyear.md index 0b8f112b58a29..9a88627bb9593 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/dayofyear.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/dayofyear.md @@ -9,16 +9,15 @@ Returns the day of the year for date, in the range 1 to 366. ``` > DAYOFYEAR(expr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | Required. The date to get the day from. Must be date type. | - - ## **Examples** - ```sql > drop table if exists t1; > create table t1(a date, b datetime,c varchar(30)); diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/month.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/month.md index a2552fea4252c..d2154770787da 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/month.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/month.md @@ -4,22 +4,20 @@ The MONTH() function returns the month part for a given date (a number from 1 to 12). - ## **Syntax** ``` > MONTH(date) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | date | Required. The date/datetime to extract the month from | - - ## **Examples** - ```sql > drop table if exists t1; > create table t1(a date, b datetime); diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/utc_timestamp.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/utc_timestamp.md index 800503239ce97..8c2c12d7d715b 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/utc_timestamp.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/utc_timestamp.md @@ -4,7 +4,6 @@ The function returns the current UTC date and time as a value in 'YYYY-MM-DD hh:mm:ss' or 'YYYYMMDDhhmmss' format, - ## **Syntax** ``` diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/weekday.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/weekday.md index 0d7cf02d8c579..b0a728379a3f9 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/weekday.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/weekday.md @@ -4,22 +4,20 @@ This function returns the weekday index for date (0 = Monday, 1 = Tuesday, … 6 = Sunday). - ## **Syntax** ``` > WEEKDAY(date) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | date | Required. | - - ## **Examples** - ```sql > drop table if exists t1; > create table t1(a date,b datetime); diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/year.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/year.md index 5c027f170868b..b0cd69618ea80 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/year.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Datetime/year.md @@ -4,23 +4,21 @@ The YEAR() or TOYEAR() function returns the year part for a given date (a number from 1000 to 9999). - ## **Syntax** ``` > YEAR(date) > TOYEAR(date) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | date | Required. The date/datetime to extract the year from | - - ## **Examples** - ```sql > drop table if exists t1; > create table t1(a date, b datetime); diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/abs.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/abs.md index 0ecb7e5886b57..1d014dd57110d 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/abs.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/abs.md @@ -4,13 +4,14 @@ ABS(X) Returns the absolute value of X, or NULL if X is NULL. - ## **Syntax** ``` > ABS(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | @@ -34,4 +35,5 @@ The result type is derived from the argument type. ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/acos.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/acos.md index 4a1082c37366e..b948548479d58 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/acos.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/acos.md @@ -4,18 +4,18 @@ The ACOS() function returns the arccosine(given in radians) of the input number. - ## **Syntax** ``` > ACOS(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | - ## **Examples** ```sql @@ -34,4 +34,5 @@ The ACOS() function returns the arccosine(given in radians) of the input number. ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/atan.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/atan.md index 398b595885d5c..6f70a2e822e74 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/atan.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/atan.md @@ -4,18 +4,18 @@ The ATAN() function returns the arctangent(given in radians) of the input number. - ## **Syntax** ``` > ATAN(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | - ## **Examples** ```sql @@ -34,4 +34,5 @@ The ATAN() function returns the arctangent(given in radians) of the input number ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/ceil.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/ceil.md index 1fba1d9aca49c..1e9a1a704282b 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/ceil.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/ceil.md @@ -4,24 +4,20 @@ The CEIL(X) function returns the smallest integer value not less than X. - ## **Syntax** ``` > CEIL(X) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | X | Required. Any numeric data type supported now. | - For exact-value numeric arguments, the return value has an exact-value numeric type. For floating-point arguments, the return value has a floating-point type. - - - - ## **Examples** ```sql @@ -66,4 +62,5 @@ For exact-value numeric arguments, the return value has an exact-value numeric t ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/cos.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/cos.md index f53bf4a2b39fb..7768f1edeb3dd 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/cos.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/cos.md @@ -4,18 +4,18 @@ The COS() function returns the cosine of input number(given in radians). - ## **Syntax** ``` > COS(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | - ## **Examples** ```sql @@ -33,4 +33,5 @@ The COS() function returns the cosine of input number(given in radians). ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/cot.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/cot.md index 24282a3a4f2ac..c8c45839acfff 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/cot.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/cot.md @@ -4,18 +4,18 @@ The COT() function returns the cotangent of input number(given in radians). - ## **Syntax** ``` > COT(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | - ## **Examples** ```sql @@ -33,4 +33,5 @@ The COT() function returns the cotangent of input number(given in radians). ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/exp.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/exp.md index 09b88b39ceb49..f1ba8f3270c51 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/exp.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/exp.md @@ -9,14 +9,13 @@ The EXP() function returns the value of e (the base of natural logarithms) raise ``` > EXP(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | - - - ## **Examples** ```sql @@ -35,4 +34,5 @@ The EXP() function returns the value of e (the base of natural logarithms) raise ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/floor.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/floor.md index ab1f73172a7cf..47731b8bee9cd 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/floor.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/floor.md @@ -4,21 +4,20 @@ The FLOOR() function returns the largest round number that is less than or equal to the number. - ## **Syntax** ``` > FLOOR(number, decimals) > FLOOR(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | | decimals| Optional. An integer that represents the number of decimal places. By default it is zero, which means to round to an integer.
**decimals** may also be negative.| - - ## **Examples** ```sql @@ -79,4 +78,5 @@ The FLOOR() function returns the largest round number that is less than or equal ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/ln.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/ln.md index feef5b3c32cfa..9fdbfc0ecfba1 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/ln.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/ln.md @@ -4,7 +4,6 @@ LN(X) returns the natural logarithm of X. This function is synonymous with LOG(X). - ## **Syntax** ``` diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/log.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/log.md index 07c8cd38b1973..33c5446ef23e4 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/log.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/log.md @@ -4,18 +4,18 @@ LOG(X) returns the natural logarithm of X. - ## **Syntax** ``` > LOG(X) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | X | Required. Any numeric data type supported now. | - ## **Examples** ```sql @@ -31,5 +31,6 @@ LOG(X) returns the natural logarithm of X. ``` ## **Constraints** + * LOG(X) only support one parameter input for now. * Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/pi.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/pi.md index ffeabeb6bc79c..0ff2638896991 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/pi.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/pi.md @@ -4,15 +4,12 @@ PI() returns the value of π (pi). - - ## **Syntax** ``` > PI() ``` - ## **Examples** ```sql @@ -49,4 +46,5 @@ PI() returns the value of π (pi). ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/power.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/power.md index b1e4bbfb6359e..344aef5d8d328 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/power.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/power.md @@ -4,20 +4,19 @@ POWER(X, Y) returns the value of X raised to the power of Y. - - ## **Syntax** ``` > POWER(X, Y) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | X | Required. Any numeric data type supported now. | | Y | Required. Any numeric data type supported now. | - ## **Examples** ```sql @@ -47,4 +46,5 @@ POWER(X, Y) returns the value of X raised to the power of Y. ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/round.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/round.md index c6d1608ccd0a4..ca32eff9cc6fc 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/round.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/round.md @@ -5,21 +5,20 @@ The ROUND() function rounds a number to a specified number of decimal places. The function returns the nearest number of the specified order. In case when given number has equal distance to surrounding numbers, the function uses banker’s rounding for float number types and rounds away from zero for the other number types (Decimal). - ## **Syntax** ``` > ROUND(number, decimals) > ROUND(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. The number to round, including any numeric data type supported now. | | decimals| Optional. An integer that represents the number of decimal places you want to round to. Default value is 0.
**decimals>0** then the function rounds the value to the right of the decimal point.
**decimals<0** then the function rounds the value to the left of the decimal point.
**decimals=0** then the function rounds the value to integer.| - - ## **Examples** ```sql @@ -92,4 +91,5 @@ The function returns the nearest number of the specified order. In case when giv ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/sin.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/sin.md index ea50db4de6ba6..6361ca2e8142c 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/sin.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/sin.md @@ -4,18 +4,18 @@ The SIN() function returns the sine of input number(given in radians). - ## **Syntax** ``` > SIN(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | - ## **Examples** ```sql @@ -33,4 +33,5 @@ The SIN() function returns the sine of input number(given in radians). ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/sinh.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/sinh.md index a9ef60111ec6a..825be20c8948f 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/sinh.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/sinh.md @@ -4,18 +4,18 @@ The SINH() function returns the hyperbolic sine of the input number(given in radians). - ## **Syntax** ``` > SINH(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | - ## **Examples** ```sql @@ -29,4 +29,5 @@ The SINH() function returns the hyperbolic sine of the input number(given in rad ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/tan.md b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/tan.md index 09ad19a556562..8fafde0b47038 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/tan.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/Mathematical/tan.md @@ -4,18 +4,18 @@ The TAN() function returns the tangent of input number(given in radians). - ## **Syntax** ``` > SIN(number) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | number | Required. Any numeric data type supported now. | - ## **Examples** ```sql @@ -33,4 +33,5 @@ The TAN() function returns the tangent of input number(given in radians). ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/empty.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/empty.md index c4c08aff48446..80b729823c399 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/empty.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/empty.md @@ -5,23 +5,24 @@ Checks whether the input string is empty. A string is considered non-empty if it contains at least one byte, even if this is a space or a null byte. - ## **Syntax** ``` > EMPTY(str) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. both CHAR and VARCHAR are supported. | ## **Returned Values** + Returns 1 for an empty string or 0 for a non-empty string. ## **Examples** - ```SQL > drop table if exists t1; > create table t1(a varchar(255),b varchar(255)); @@ -37,5 +38,5 @@ Returns 1 for an empty string or 0 for a non-empty string. ``` ## **Constraints** -Currently, MatrixOne doesn't support select function() without from tables. +Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/endswith.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/endswith.md index b7c48de2cc5a3..016e310c5b580 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/endswith.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/endswith.md @@ -9,13 +9,16 @@ Returns whether to end with the specified suffix. Returns 1 if the string ends w ``` > ENDSWITH(str,suffix) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. CHAR and VARCHAR both are supported.| | suffix | Required. CHAR and VARCHAR both are supported.| ## **Returned Values** + * 1, if the string ends with the specified suffix. * 0, if the string does not end with the specified suffix. @@ -52,4 +55,5 @@ Returns whether to end with the specified suffix. Returns 1 if the string ends w ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/length.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/length.md index 2c7b774a6de93..26f74b15f7ee1 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/length.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/length.md @@ -4,21 +4,20 @@ The length() function returns the length of the string. - ## **Syntax** ``` > LENGTH(str) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. String you want to calculate. | - ## **Examples** - ``` > select a,length(a) from t1; @@ -29,5 +28,5 @@ abc 3 ``` ## Constraints -Currently, MatrixOne doesn't support select function() without from tables. +Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/lengthUTF8.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/lengthUTF8.md index 8e4ac50b1f778..2b087e2411dcb 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/lengthUTF8.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/lengthUTF8.md @@ -4,21 +4,20 @@ The lengthUTF8() function returns the length of the string str, measured in code points. A multibyte character counts as a single code point. This means that, for a string containing two 3-byte characters, LENGTH() returns 6, whereas LENGTHUTF8() returns 2. - ## **Syntax** ``` > LENGTHUTF8(str) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. String you want to calculate. | - ## **Examples** - ```sql > drop table if exists t1; > create table t1(a varchar(255),b varchar(255)); @@ -33,5 +32,5 @@ The lengthUTF8() function returns the length of the string str, measured in code ``` ## Constraints -Currently, MatrixOne doesn't support select function() without from tables. +Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/lpad.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/lpad.md index adbc973a8ce83..c9e89e315a897 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/lpad.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/lpad.md @@ -9,15 +9,15 @@ This function LPAD(str,len,padstr) returns the string *str*, left-padded with th ``` > LPAD(str,len,padstr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. The string to be padded. CHAR and VARCHAR both are supported.| | len | Required. | | padstr | Required. The string used to pad on the left. CHAR and VARCHAR both are supported.| - - ## **Examples** ```sql @@ -78,4 +78,5 @@ VALUES ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/ltrim.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/ltrim.md index 1dedf38a0a705..6449fc5c2a771 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/ltrim.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/ltrim.md @@ -9,13 +9,13 @@ This function LTRIM() returns the string with leading space characters removed. ``` > LTRIM(str) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. CHAR and VARCHAR both are supported.| - - ## **Examples** ```sql @@ -32,4 +32,5 @@ This function LTRIM() returns the string with leading space characters removed. ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/reverse.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/reverse.md index 33a4806f0c42b..a56b07f19cdb1 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/reverse.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/reverse.md @@ -4,21 +4,20 @@ Returns the string str with the order of the characters reversed. - ## **Syntax** ``` > REVERSE(str) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | Str | Required. both CHAR and VARCHAR are supported. | - ## **Examples** - ```SQL > drop table if exists t1; > create table t1(a varchar(12),c char(30)); @@ -54,5 +53,5 @@ Returns the string str with the order of the characters reversed. ``` ## Constraints -Currently, MatrixOne doesn't support select function() without from tables. +Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/rpad.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/rpad.md index e7a7b78eb91ab..ef17205827cbe 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/rpad.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/rpad.md @@ -9,15 +9,15 @@ This function RPAD(str,len,padstr) returns the string *str*, right-padded with t ``` > RPAD(str,len,padstr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. The string to be padded. CHAR and VARCHAR both are supported.| | len | Required. | | padstr | Required. The string used to pad on the right. CHAR and VARCHAR both are supported.| - - ## **Examples** ```sql @@ -78,4 +78,5 @@ VALUES ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/rtrim.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/rtrim.md index b68ee52a9a9d2..231f8adfc1640 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/rtrim.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/rtrim.md @@ -9,13 +9,13 @@ This function RTRIM() returns the string with trailing space characters removed. ``` > RTRIM(str) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. CHAR and VARCHAR both are supported.| - - ## **Examples** ```sql @@ -32,4 +32,5 @@ This function RTRIM() returns the string with trailing space characters removed. ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/space.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/space.md index 515ca8b3234e3..902704bc5eb4c 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/space.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/space.md @@ -4,22 +4,20 @@ SPACE(N) Returns a string consisting of N space characters. - - ## **Syntax** ``` > SPACE(N) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | N | Required. UINT Type | - ## **Examples** - ```SQL > drop table if exists t1; > CREATE TABLE t1 @@ -50,5 +48,5 @@ VALUES ``` ## Constraints -Currently, MatrixOne doesn't support select function() without from tables. +Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/startswith.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/startswith.md index b575148c50a3d..99a8b6b9c0c2b 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/startswith.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/startswith.md @@ -9,13 +9,16 @@ Returns 1 whether string starts with the specified prefix, otherwise it returns ``` > STARTSWITH(str,prefix) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. CHAR and VARCHAR both are supported.| | prefix | Required. CHAR and VARCHAR both are supported.| ## **Returned Values** + * 1, if the string starts with the specified prefix. * 0, if the string does not start with the specified prefix. @@ -51,4 +54,5 @@ Returns 1 whether string starts with the specified prefix, otherwise it returns ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/Builtin-Functions/String/substring.md b/docs/en/MatrixOne/Reference/Builtin-Functions/String/substring.md index f52a2bebe37ef..7923e3330bcbe 100644 --- a/docs/en/MatrixOne/Reference/Builtin-Functions/String/substring.md +++ b/docs/en/MatrixOne/Reference/Builtin-Functions/String/substring.md @@ -11,17 +11,17 @@ The forms without a len argument return a substring from string str starting at > SUBSTRING(str,pos) > SUBSTR(str,pos,len) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | str | Required. CHAR and VARCHAR are both supported | | pos | Required. | | len | Optional. | - ## **Examples** - ```SQL > CREATE TABLE IF NOT EXISTS t1 ( pub_id varchar(8) COLLATE latin1_general_ci NOT NULL DEFAULT '', @@ -65,5 +65,6 @@ estd date NOT NULL DEFAULT '2000-01-01' ``` ## Constraints + * Currently, MatrixOne doesn't support select function() without from tables. * Currently, Substring() doesn't support FROM and FOR clauses. diff --git a/docs/en/MatrixOne/Reference/Data-Types/data-types.md b/docs/en/MatrixOne/Reference/Data-Types/data-types.md index d3fb95720a439..e20c327854b2e 100644 --- a/docs/en/MatrixOne/Reference/Data-Types/data-types.md +++ b/docs/en/MatrixOne/Reference/Data-Types/data-types.md @@ -37,7 +37,6 @@ Reference: | Date | 4 byte | day | 1000-01-01 | 9999-12-31 | YYYY-MM-DD/YYYYMMDD | | DateTime | 4 byte | second | 1970-01-01 00:00:00 | 2105-12-31 23:59:59 | YYYY-MM-DD hh:mm:ss | - ## **Decimal Types(Beta)** | Data Type | Size | Precision | Syntax | @@ -45,7 +44,6 @@ Reference: | Decimal64 | 8 byte | 19 digits | Decimal(N,S), N range(1,18), S range(0,N) | | Decimal128 | 16 byte | 38 digits | Decimal(N,S), N range(19,38), S range(0,N) | - ## **Examples** ```sql diff --git a/docs/en/MatrixOne/Reference/Data-Types/fixed-point-types.md b/docs/en/MatrixOne/Reference/Data-Types/fixed-point-types.md index 10a806fd2097f..2c11a5e56cf8b 100644 --- a/docs/en/MatrixOne/Reference/Data-Types/fixed-point-types.md +++ b/docs/en/MatrixOne/Reference/Data-Types/fixed-point-types.md @@ -18,8 +18,6 @@ If the scale is 0, DECIMAL values contain no decimal point or fractional part. In MatrixOne, the maximum number of digits for DECIMAL is 38, but the actual range for a given DECIMAL column can be constrained by the precision or scale for a given column. When such a column is assigned a value with more digits following the decimal point than are permitted by the specified scale, the value is converted to that scale. - - ## DECIMAL Data Type Characteristics This section discusses the characteristics of the DECIMAL data type (and its synonyms), with particular regard to the following topics: @@ -46,4 +44,3 @@ Values for DECIMAL columns are stored using a binary format that packs decimal d | 19-38 | 16 bytes | For a full explanation of the internal implementation of DECIMAL values, see the [Feature Design](https://github.com/matrixorigin/matrixone/issues/1867). - diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/avg.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/avg.md index 6512c70d04da2..3117e98897fe3 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/avg.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/avg.md @@ -6,18 +6,20 @@ Aggregate function. The AVG() function calculates the average value of the argument. - ## **Syntax** ``` > AVG(expr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | Any numerical expression | ## **Returned Value** + The arithmetic mean, always as Double. NaN if the input parameter is empty. @@ -63,4 +65,5 @@ NaN if the input parameter is empty. ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_and.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_and.md index 02a3453c7bbd0..bf069ebde052a 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_and.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_and.md @@ -6,18 +6,18 @@ Aggregate function. The BIT_AND(expr) function returns the bitwise AND of all bits in expr. - ## **Syntax** ``` > BIT_AND(expr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | UINT data types | - ## **Examples** ```sql diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_or.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_or.md index 5d847ee39db40..81dfa60b2a26e 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_or.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_or.md @@ -6,18 +6,18 @@ Aggregate function. The BIT_OR(expr) function returns the bitwise OR of all bits in expr. - ## **Syntax** ``` > BIT_OR(expr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | UINT data types | - ## **Examples** ```sql diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_xor.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_xor.md index 62d440086c2d7..5c1887e658818 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_xor.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/bit_xor.md @@ -6,18 +6,18 @@ Aggregate function. The BIT_XOR(expr) function returns the bitwise XOR of all bits in expr. - ## **Syntax** ``` > BIT_XOR(expr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | UINT data types | - ## **Examples** ```sql diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/count.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/count.md index d2dc467b36600..3607e6914e172 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/count.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/count.md @@ -13,19 +13,21 @@ Note: NULL values are not counted. ``` > COUNT(expr) ``` + *** ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | Any expression.This may be a column name, the result of another function, or a math operation. * is also allowed, to indicate pure row counting. | ## **Returned Value** + Returns a count of the number of non-NULL values of `expr` in the rows retrieved by a SELECT statement. The result is a BIGINT value. If there are no matching rows, COUNT() returns 0. - ## **Examples** ```sql @@ -54,4 +56,5 @@ If there are no matching rows, COUNT() returns 0. ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/max.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/max.md index 9f74bf210e43f..77125d0011cad 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/max.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/max.md @@ -13,11 +13,13 @@ The MAX() function calculates the maximum value across a group of values. ``` ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | Any expression | ## **Returned Value** + Returns the maximum value of expr. MAX() may take a string argument, in such cases, it returns the maximum string value. ## **Examples** @@ -50,6 +52,6 @@ Returns the maximum value of expr. MAX() may take a string argument, in such cas +------+ ``` - ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. \ No newline at end of file diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/min.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/min.md index c97357456fae5..046cbf2e17661 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/min.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/min.md @@ -13,11 +13,13 @@ The MAX() function calculates the maximum value across a group of values. ``` ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | Any expression | ## **Returned Value** + Returns the minimum value of expr. MIN() may take a string argument, in such cases, it returns the minimum string value. ## **Examples** @@ -50,6 +52,6 @@ Returns the minimum value of expr. MIN() may take a string argument, in such cas +------+ ``` - ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. \ No newline at end of file diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/stddev_pop.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/stddev_pop.md index 2486930490707..31048bce1d920 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/stddev_pop.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/stddev_pop.md @@ -6,18 +6,18 @@ Aggregate function. The STDDEV_POP(expr) function returns the population standard deviation of expr. - ## **Syntax** ``` > STDDEV_POP(expr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | Any numerical expressions | - ## **Examples** ```sql diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/sum.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/sum.md index a60ae97dade5a..ff07f1abc33ad 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/sum.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/sum.md @@ -15,18 +15,19 @@ Note: NULL values are not counted. ``` ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | Any expression | ## **Returned Value** + Returns the sum of expr. A double if the input type is double, otherwise integer. If there are no matching rows, SUM() returns NULL. ## **Examples** - ```sql > drop table if exists tbl1,tbl2; > create table tbl1 (col_1a tinyint, col_1b smallint, col_1c int, col_1d bigint, col_1e char(10) not null); @@ -57,4 +58,5 @@ If there are no matching rows, SUM() returns NULL. ``` ## Constraints + Currently, MatrixOne doesn't support select function() without from tables. diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/var.md b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/var.md index 1e522748f7a0b..1cd29aa2a4339 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/var.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Aggregate-Functions/var.md @@ -6,18 +6,18 @@ Aggregate function. The VAR(expr) function returns the population standard variance of expr. - ## **Syntax** ``` > VAR(expr) ``` + ## **Arguments** + | Arguments | Description | | ---- | ---- | | expr | Any numerical expressions | - ## **Examples** ```sql diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md index 7eaef4f0030c0..75de3ef183bf9 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md @@ -1,6 +1,7 @@ # **CREATE DATABASE** ## **Description** + Create a database. ## **Syntax** @@ -15,11 +16,12 @@ Create a database. } ``` -#### create_database_statement: +#### create_database_statement ![Create Database Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/reference/create_database_statement.png?raw=true) ## **Examples** + ``` > CREATE DATABASE test01; diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md index a9291716eb182..46d4662d27b3c 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md @@ -1,6 +1,7 @@ # **CREATE INDEX** ## **Description** + Create an index on a table column. ## **Syntax** @@ -10,8 +11,8 @@ Create an index on a table column. ``` - ## **Examples** + ``` > CREATE INDEX PIndex ON Persons (LastName); diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-table.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-table.md index 0a6d91f1484be..f6eda5dd378da 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-table.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-table.md @@ -1,6 +1,7 @@ # **CREATE TABLE** ## **Description** + Create a new table. ## **Syntax** @@ -14,11 +15,12 @@ Create a new table. ) ``` -#### create_table_statement: +#### create_table_statement ![Create Table Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/reference/create_table_statement.png?raw=true) ## **Examples** + ``` > CREATE TABLE test(a int, b varchar(10)); diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-database.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-database.md index 9059f6e35e5f2..b864d42ce1c03 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-database.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-database.md @@ -1,6 +1,7 @@ # **DROP DATABASE** ## **Description** + Drop a database. ## **Syntax** @@ -9,11 +10,12 @@ Drop a database. > DROP DATABASE [IF EXISTS] ``` -#### drop_database_statement: +#### drop_database_statement ![Drop Database Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/reference/drop_database_statement.png?raw=true) ## **Examples** + ``` > DROP DATABASE test01; ``` diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md index c1c001f2f53ba..435db01e8f0ea 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md @@ -1,6 +1,7 @@ # **DROP INDEX** ## **Description** + DROP INDEX drops the index named index_name from the table table_name. ## **Syntax** @@ -9,8 +10,8 @@ DROP INDEX drops the index named index_name from the table table_name. > DROP INDEX index_name ON table_name; ``` - ## **Examples** + ``` > DROP INDEX PIndex ON Persons; diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-table.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-table.md index 39a6ea15db423..43e2d1158b247 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-table.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-table.md @@ -1,6 +1,7 @@ # **DROP TABLE** ## **Description** + Deletes the table. ## **Syntax** @@ -9,11 +10,12 @@ Deletes the table. > DROP TABLE [IF EXISTS] [db.]name ``` -#### drop_table_statement: +#### drop_table_statement ![Drop Table Diagram](https://github.com/matrixorigin/artwork/blob/main/docs/reference/drop_table_statement.png?raw=true) ## **Examples** + ``` > CREATE TABLE table01(a int); > DROP TABLE table01; diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md index 082a9ddbff0eb..b08c6cb9d4c8a 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md @@ -1,6 +1,7 @@ # **PRIMARY KEY** ## **Description** + The PRIMARY KEY constraint uniquely identifies each record in a table. Primary keys must contain UNIQUE values, and cannot contain NULL values. @@ -11,7 +12,6 @@ A table can have only ONE primary key; and in the table, this primary key can co The following SQL creates a PRIMARY KEY on the "ID" column when the "Persons" table is created: - ``` > CREATE TABLE Persons ( ID int NOT NULL, @@ -36,7 +36,6 @@ To allow naming of a PRIMARY KEY constraint, and for defining a PRIMARY KEY cons Note: In the example above there is only ONE PRIMARY KEY (PK_Person). However, the VALUE of the primary key is made up of TWO COLUMNS (ID + LastName). - ## **Constraints** `DROP PRIMARY KEY` is not supported yet. \ No newline at end of file diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/cast.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/cast.md index c65606396ffb5..df5de3ac7d94f 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/cast.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/cast.md @@ -1,30 +1,31 @@ # **CAST** ## **Description** + The CAST() function converts a value (of any type) into the specified datatype. ## **Syntax** + ``` > CAST(value AS datatype) ``` ## **Parameter Values** + | Parameter | Description | | ---- | ---- | | value | Required. The value to convert | | datatype | Required. The datatype to convert to | - - Currently, `cast` can support following conversion: + * Conversion between numeric types, mainly including SIGNED, UNSIGNED, FLOAT, and DOUBLE type. * Numeric types to character CHAR type. * Numeric character types to numerical types(negative into SIGNED). ## **Examples** - ```sql > drop table if exists t1; > CREATE TABLE t1 (a int,b float,c char(1),d varchar(15)); @@ -44,13 +45,11 @@ Currently, `cast` can support following conversion: +--------+--------+--------+---------+ ``` - ## **Constraints** + Currently, MatrixOne doesn't support select function() without from tables. * Non-numeric character types cannot be converted to numeric types. * Numeric and character types with formats of Data cannot be converted to Date. * Date and Datetime types cannot be converted to character types. * Date and Datetime cannot be converted to each other. - - diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/in.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/in.md index 2e1e4ae3fcd80..a6fc01db08e02 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/in.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/in.md @@ -1,16 +1,19 @@ # **IN** ## **Description** -The `IN` operator allows you to specify multiple values in a `WHERE` clause. And it's a shorthand for multiple `OR` conditions. +The `IN` operator allows you to specify multiple values in a `WHERE` clause. And it's a shorthand for multiple `OR` conditions. ## **Syntax** + ``` > SELECT column1, column2, ... FROM table_name WHERE column_name IN (value1, value2, ...); ``` + ## **Examples** + ``` sql > create table t2(a int,b varchar(5),c float, d date, e datetime); > insert into t2 values(1,'a',1.001,'2022-02-08','2022-02-08 12:00:00'); @@ -41,8 +44,6 @@ a b c d e ``` - - ## **Constraints** * Currently, only constant lists are supported on the left side of `IN`. diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/inner-join.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/inner-join.md index aa351f8cd09da..de97c3e604215 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/inner-join.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/inner-join.md @@ -1,10 +1,11 @@ # **INNER JOIN** ## **Description** -The INNER JOIN keyword selects records that have matching values in both tables.(Same as `JOIN`) +The INNER JOIN keyword selects records that have matching values in both tables.(Same as `JOIN`) ## **Syntax** + ``` > SELECT column_name(s) FROM table1 @@ -13,7 +14,6 @@ ON table1.column_name = table2.column_name; ``` - ## **Examples** ```sql @@ -59,5 +59,5 @@ ON table1.column_name = table2.column_name; ``` ## **Constraints** -Currently, `INNER JOIN` statement may cause crashing when executing some quiries. +Currently, `INNER JOIN` statement may cause crashing when executing some quiries. diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md index 8b3abed57a64e..d8faec5340b18 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md @@ -1,6 +1,7 @@ # **INSERT** ## **Description** + Writing data. ## **Syntax** diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/like.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/like.md index 45ec0c1690318..5b1d2945ab30a 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/like.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/like.md @@ -1,6 +1,7 @@ # **LIKE** ## **Description** + The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. There are two wildcards often used in conjunction with the LIKE operator: @@ -9,12 +10,15 @@ There are two wildcards often used in conjunction with the LIKE operator: * The underscore sign (_) represents one, single character ## **Syntax** + ``` > SELECT column1, column2, ... FROM table_name WHERE columnN LIKE pattern; ``` + ## **Examples** + ```sql > SELECT * FROM Customers WHERE CustomerName LIKE 'a%'; //The following SQL statement selects all customers with a CustomerName starting with "a" diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md index 45b32b61fd594..66375bb4f5936 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md @@ -1,6 +1,7 @@ # **LOAD DATA** ## **Description** + The LOAD DATA statement reads rows from a text file into a table at a very high speed. ## **Syntax** @@ -33,6 +34,7 @@ The LOAD DATA statement reads rows from a text file into a table at a very high The SSB Test is an example of LOAD DATA syntax. [Complete a SSB Test with MatrixOne ](../../../Get-Started/Tutorial/SSB-test-with-matrixone.md) + ``` > LOAD DATA INFILE '/ssb-dbgen-path/lineorder_flat.tbl ' INTO TABLE lineorder_flat; ``` diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md index 26d6474cdc697..3061b81e3afb6 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md @@ -1,6 +1,7 @@ # **SELECT** ## **Description** + Retrieves data from a table. ## **Syntax** @@ -21,14 +22,13 @@ Retrieves data from a table. ] ``` - ### **SELECT INTO** + `SELECT INTO` statement enables a query result to be stored in variables or written to a file * SELECT ... INTO ***var_list*** selects column values and stores them into variables. * SELECT ... INTO OUTFILE writes the selected rows to a file. Column and line terminators can be specified to produce a specific output format. - ``` sql > SELECT INTO OUTFILE 'file_name' @@ -55,13 +55,12 @@ Retrieves data from a table. * You can limit the maximum size of the file using `MAX_FILE_SIZE` in KB. For example, with `MAX_FILE_SIZE`=5242880(5GB), tables with size of 10GB are exported as two files distinguished by the ordinal number in their name. When this value is not set, one file will be exported by default. -* `FORCE_QUOTE` is used to add double quotes for every `NOT NULL ` value in the specified column. +* `FORCE_QUOTE` is used to add double quotes for every `NOT NULL` value in the specified column. * `NULL` values will be exported as `\N`. !!! info Suggestions If `MAX_FILE_SIZE` is not set, a large file may be exported and the operation may fail. Therefore, we recommend you to set this value case by case. - #### Constraints * The query will fail if a file with the same filename already exists. diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-databases.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-databases.md index bb83ff616b347..0497ff702886a 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-databases.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-databases.md @@ -5,10 +5,13 @@ Shows the list of databases that exist on the instance. ## **Syntax** + ``` > SHOW DATABASES [LIKE expr | WHERE expr] ``` + ## **Examples** + ```sql > SHOW DATABASES; +----------+ @@ -26,4 +29,3 @@ Shows the list of databases that exist on the instance. +----------+ 9 rows in set (0.00 sec) ``` - diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-tables.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-tables.md index c294338d93cf2..2f27209fbd434 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-tables.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/show-tables.md @@ -1,13 +1,17 @@ # **SHOW TABLES** ## **Description** + Shows the list of tables in the currently selected database. ## **Syntax** + ``` > SHOW TABLES [LIKE 'pattern' | WHERE expr | FROM 'pattern' | IN 'pattern'] ``` + ## **Examples** + ```sql > SHOW TABLES; +---------------+ diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/subquery.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/subquery.md index fad2a28d349ad..06d3f66eef137 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/subquery.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/subquery.md @@ -3,6 +3,7 @@ A subquery is a SQL query nested inside a larger query. A subquery may occur in: + - A SELECT clause - A FROM clause - A WHERE clause @@ -22,6 +23,7 @@ Every table in a FROM clause must have a name, therefore the [AS] name clause is ``` ### **Examples** + ```sql > CREATE TABLE tb1 (c1 INT, c2 CHAR(5), c3 FLOAT); > INSERT INTO tb1 VALUES (1, '1', 1.0); @@ -48,4 +50,5 @@ Every table in a FROM clause must have a name, therefore the [AS] name clause is ``` ## Constraints + MatrixOne only support subquery from FROM clause for now. \ No newline at end of file diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/use.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/use.md index 0fc2d6a0e767e..3ba79ef607cda 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/use.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/use.md @@ -1,13 +1,17 @@ # **USE** ## **Description** + The USE statement tells MatrixOne to use the named database as the default (current) database for subsequent statements. ## **Syntax** + ``` > USE db_name ``` + ## **Examples** + ```sql > USE db1; > SELECT COUNT(*) FROM mytable; diff --git a/docs/en/MatrixOne/Reference/System-Parameters/configuration-settings.md b/docs/en/MatrixOne/Reference/System-Parameters/configuration-settings.md index 2ed345eff33c4..6ceeb3cbb593a 100644 --- a/docs/en/MatrixOne/Reference/System-Parameters/configuration-settings.md +++ b/docs/en/MatrixOne/Reference/System-Parameters/configuration-settings.md @@ -13,10 +13,8 @@ The 0.1.0 version is a standalone version, only the following parameters should | sendRow | bool | false | [true, false] | send data row while producing | | dumpEnv | bool | false | [true, false] | dump Environment with memEngine Null nodes for testing | - ### Debug Settings - | Parameter | Type | Default Value | Range | Functionality | | ---- | ---- | -------- | --- | --- | | level | string | debug | [debug, info, warn, error, fatal] | the log output level | @@ -26,7 +24,6 @@ The 0.1.0 version is a standalone version, only the following parameters should | max-days | int64 | 0 | [0 - 314572800] | maximum log file days kept| | max-backups | int64 | 0 | [0 - 314572800] | maximum numbers of old log files to retain| - ### Memory Settings | Parameter | Type | Default Value | Range | Functionality | @@ -39,5 +36,3 @@ The 0.1.0 version is a standalone version, only the following parameters should | processLimitationBatchRows | int64 | 42949672960 | [0 - 42949672960] | process.Limitation.BatchRows. default: 10 << 32 = 42949672960 | | processLimitationBatchRows | int64 | 42949672960 | [0 - 42949672960] | process.Limitation.BatchRows. default: 10 << 32 = 42949672960 | | processLimitationPartitionRows | int64 | 42949672960 | [0 - 42949672960] | process.Limitation.PartitionRows. default: 10 << 32 = 42949672960 | - - diff --git a/docs/en/MatrixOne/Reference/System-Parameters/distributed-settings.md b/docs/en/MatrixOne/Reference/System-Parameters/distributed-settings.md index 855e0127b1ae8..0615d6f89d9da 100644 --- a/docs/en/MatrixOne/Reference/System-Parameters/distributed-settings.md +++ b/docs/en/MatrixOne/Reference/System-Parameters/distributed-settings.md @@ -1,7 +1,5 @@ For a distributed setting, the following parameters should be paied attention to. - - ### Configuration Settings To configurate a distributed setting, following parameters need to be modified in the default Configuration file 'system_vars_config.toml'. @@ -34,7 +32,6 @@ To configurate a distributed setting, following parameters need to be modified i addr-advertise-raft = "${HOST}:10000" ``` - * **addr-client and addr-advertise-client** `addr-client` is the address for cube service. @@ -58,7 +55,6 @@ To configurate a distributed setting, following parameters need to be modified i addr-advertise-client = "${HOST}:20000" ``` - * **dir-data** `dir-data` is the directory for cube data. In a cluster, each node should have a different `dir-data`. @@ -196,4 +192,3 @@ To configurate a distributed setting, following parameters need to be modified i ``` max-replicas = 3 ``` - diff --git a/docs/en/MatrixOne/Release-Notes/v0.1.0.md b/docs/en/MatrixOne/Release-Notes/v0.1.0.md index 67fbaefd6c16a..c86fe02ad99a1 100644 --- a/docs/en/MatrixOne/Release-Notes/v0.1.0.md +++ b/docs/en/MatrixOne/Release-Notes/v0.1.0.md @@ -1,10 +1,10 @@ # **MatrixOne v0.1.0 Release Notes** - We are excited to announce the first release of MatrixOne 0.1.0 on 2021/10/24. Cheers! *** ## **Docker** + docker pull matrixorigin/matrixone:0.1.0 *** @@ -14,14 +14,18 @@ docker pull matrixorigin/matrixone:0.1.0 *** ### **SQL** + Following SQL statements are supported in this release. *** ### **DDL** + * CREATE / DROP DATABASE * CREATE / DROP TABLE + ### **DML** + * INSERT * LOAD DATA * SELECT @@ -33,16 +37,21 @@ Following SQL statements are supported in this release. - DATABASES - TABLES * USE + ### **Data Types** + * TINYINT / SMALLINT / INT / BIGINT, SIGNED / UNSIGNED * FLOAT / DOUBLE * CHAR / VARCHAR + ### **Operators** + * <, >=, <, <=, <>, !=, = * BETWEEN … AND …, NOT BETWEEN … AND … * AND, &&, OR, || * +, -, *, /, %, MOD, DIV, NEG * CAST + ### **Aggregation Functions** * COUNT @@ -52,7 +61,9 @@ Following SQL statements are supported in this release. * MIN ## **Database Engine** + *** + * MySQL dialect is supported. * Build-in Append only columnar engine(AOE) has been supported as the first fusion database engine. * Real-time analytical queries are supported. @@ -60,7 +71,9 @@ Following SQL statements are supported in this release. * Part of the expression execution has been vectorized through SIMD instructions. * Distributed AOE with strong consistency guaranteed by RAFT has been supported. * The performance of replicated state machine has been greatly improved through the unique design of reusing RAFT log as well as Write-Ahead log without any redundancy. + ## **Contributors** + *** This release includes 453 commits by 16 authors. Special thanks to the first author: diff --git a/docs/en/MatrixOne/Release-Notes/v0.2.0.md b/docs/en/MatrixOne/Release-Notes/v0.2.0.md index f1f3046af72b9..f2c35db4f86af 100644 --- a/docs/en/MatrixOne/Release-Notes/v0.2.0.md +++ b/docs/en/MatrixOne/Release-Notes/v0.2.0.md @@ -1,11 +1,11 @@ # **MatrixOne v0.2.0 Release Notes** - We are excited to announce MatrixOne 0.2.0 release. Cheers! *** ## **Docker** + docker pull matrixorigin/matrixone:0.2.0 *** @@ -24,11 +24,13 @@ docker pull matrixorigin/matrixone:0.2.0 * Support new types of DATE and DATETIME. ## **Database Engine** + *** * For continuous table creation actions in a script, the parameter of pre-allocated-group-num should be set to a bigger value such in cluster scenarios. Otherwise, "no available raft group" may be notified during tables creation sequence. ## **Contributors** + *** This release includes 243 commits by 21 authors. diff --git a/docs/en/MatrixOne/Release-Notes/v0.3.0.md b/docs/en/MatrixOne/Release-Notes/v0.3.0.md index 9f6a30b2641cf..325d9987eeb0f 100644 --- a/docs/en/MatrixOne/Release-Notes/v0.3.0.md +++ b/docs/en/MatrixOne/Release-Notes/v0.3.0.md @@ -3,9 +3,11 @@ We are excited to announce MatrixOne 0.3.0 release. Cheers! # Docker + docker pull matrixorigin/matrixone:0.3.0 # Features + - Exports data into CSV file. - Introduces parallel execution and improve performance for projection query. - Introduces IN operator and allows you to specify multiple values in a WHERE clause. @@ -13,11 +15,12 @@ docker pull matrixorigin/matrixone:0.3.0 - Introduces new functions: round and floor. - Introduces a Chaos Testing framework for distributed system. - # Known issues + - For continuous table creation actions in a script, the parameter of pre-allocated-group-num should be set to a bigger value such in cluster scenarios. Otherwise, "no available raft group" may be notified during tables creation sequence. # Contributors + This release includes 157 commits by 21 authors. - broccoliSpicy(@broccoliSpicy) @@ -43,14 +46,14 @@ This release includes 157 commits by 21 authors. - Zhang Yingfeng (@yingfeng) ## New Contributors -* @wanhanbo made their first contribution in https://github.com/matrixorigin/matrixone/pull/1600 -* @ikenchina made their first contribution in https://github.com/matrixorigin/matrixone/pull/1685 -* @sundy-li made their first contribution in https://github.com/matrixorigin/matrixone/pull/1704 -* @WenhaoKong2001 made their first contribution in https://github.com/matrixorigin/matrixone/pull/1838 + +* @wanhanbo made their first contribution in +* @ikenchina made their first contribution in +* @sundy-li made their first contribution in +* @WenhaoKong2001 made their first contribution in We appreciate your contribution! Welcome to MatrixOne community. ## Full Changelog -https://github.com/matrixorigin/matrixone/compare/v0.2.0...v0.3.0 - + diff --git a/docs/en/MatrixOne/Release-Notes/v0.4.0.md b/docs/en/MatrixOne/Release-Notes/v0.4.0.md index f88cca92ed072..e746c02d3a0bb 100644 --- a/docs/en/MatrixOne/Release-Notes/v0.4.0.md +++ b/docs/en/MatrixOne/Release-Notes/v0.4.0.md @@ -3,9 +3,11 @@ We are excited to announce MatrixOne 0.4.0 release. Cheers! # Docker + docker pull matrixorigin/matrixone:0.4.0 # Features + - Support inner join with equality operator. - Support subquery within from clause. - Support decimal data type. @@ -17,12 +19,15 @@ docker pull matrixorigin/matrixone:0.4.0 - Bit_and, Bit_or, Bit_xor, Stddev_pop, Var # Known issues + - For continuous table creation actions in a script, the parameter of pre-allocated-group-num should be set to a bigger value such in cluster scenarios. Otherwise, "no available raft group" may be notified during tables creation sequence. # Contributors + This release includes 253 commits by 50 authors. ## New Contributors + * @BePPPower * @JackTan25 * @Charlie17Li @@ -57,5 +62,4 @@ We appreciate your contribution! Welcome to MatrixOne community. ## Full Changelog -https://github.com/matrixorigin/matrixone/compare/v0.3.0...v0.4.0 - + diff --git a/docs/en/MatrixOne/glossary.md b/docs/en/MatrixOne/glossary.md index dbb21d0a3155d..62a03a83a0acd 100644 --- a/docs/en/MatrixOne/glossary.md +++ b/docs/en/MatrixOne/glossary.md @@ -15,13 +15,13 @@ It's helpful to understand a few terms before reading our architecture documenta | E | | | Event Notify | The machanism of synchronizing heartbeat information to all nodes is called an event notify. | | F | | - | Factorization | The factorization method uses basic factorization formula to reduce any algebraic or quadratic equation into its simpler form. MatrixOne uses compact factorised representations at the physical layer to reduce data redundancy and boost query performance. | + | Factorization | The factorization method uses basic factorization formula to reduce any algebraic or quadratic equation into its simpler form. MatrixOne uses compact factorized representations at the physical layer to reduce data redundancy and boost query performance. | | H | | | Heartbeat | Every node in a MatrixOne cluster will periodically sends its status information, this information is called a heartbeat. | | M | | | MatrixCube | MatrixCube is a framework for building distributed systems, which offers guarantees about reliability, consistency, and scalability. It is designed to facilitate distributed, stateful application building to allow developers only need to focus on the business logic on a single node. | | P | | - | Prophet | Prophet is a scheduling module in MatrixCube. It takes charge of Auto-Rebalance, which keeps the system storage level and read/write throughput level balanced across Stores. The inital 3 Stores of a MatrixCube cluster are all Prophet Nodes. | + | Prophet | Prophet is a scheduling module in MatrixCube. It takes charge of Auto-Rebalance, which keeps the system storage level and read/write throughput level balanced across Stores. The initial 3 Stores of a MatrixCube cluster are all Prophet Nodes. | | Pure Storage | In contrast to Prophet, pure storage is another type of node, which doesn't handle any scheduling job and works as simple storage. | | R | | | Replica | To provide reliable service, each shard is stored not only once, it will have several copy stored in different stores. Every copy of a shard is called a Replica. | @@ -32,12 +32,10 @@ It's helpful to understand a few terms before reading our architecture documenta | Shard Splitting | There is a certain limit to a Shard size. Whenever a Shard exceeds its storage limit, MatrixCube splits a Shard into two Shards and keep each Shard with the same storage level. | | Shard Proxy | The Shard Proxy is a central module to accept all user read/write requests and route requests to corresponding nodes.| - ### **Concepts** MatrixOne relies heavily on the following concepts. Being familiar with them will help you understand what our architecture achieves. - | Term | Definition | | ---- | ---- | | A | | @@ -51,7 +49,7 @@ MatrixOne relies heavily on the following concepts. Being familiar with them wil | J | | | JIT Compilation | Turns SQL plan tree or Intermediate Representation code into a native program using LLVM at runtime. | | M | | -| Monolitic Engine | A monolithic database engine is designed to support hybrid workloads: transactional, analytical, streaming, time-series, machine learning, etc. | +| Monolithic Engine | A monolithic database engine is designed to support hybrid workloads: transactional, analytical, streaming, time-series, machine learning, etc. | | Materialized View | A materialized view is a pre-computed data set derived from a query specification (the SELECT in the view definition) and stored for later use. Materialized view is usually used for increasing performance and efficiency. | | Metadata | Metadata is the data that describes the structure and creation method of data in a database. | | P | |