Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve functions reference #1049

Merged
merged 15 commits into from
Jul 10, 2024
Merged

docs: improve functions reference #1049

merged 15 commits into from
Jul 10, 2024

Conversation

killme2008
Copy link
Contributor

@killme2008 killme2008 commented Jul 10, 2024

What's Changed in this PR

Describe the change in this PR

  • A script to update DataFusion functions:
ruby misc/update_functions.rb [nightly | v0.x]

Checklist

  • Please confirm that all corresponding versions of the documents have been revised.
  • Please ensure that the content in summary.yml matches the current document structure when you changed the document structure.
  • This change requires follow-up update in localized docs.

Summary by CodeRabbit

  • Documentation
    • Updated the overview of Datafusion and GreptimeDB functions in both English and Chinese documentation.
    • Corrected link references for the Interval type in both English and Chinese documentation.

@killme2008 killme2008 requested review from nicecui and a team as code owners July 10, 2024 00:46
Copy link
Contributor

coderabbitai bot commented Jul 10, 2024

Walkthrough

The documentation has been updated to provide comprehensive overviews and examples of functions in Datafusion and GreptimeDB, including a correction of the link reference for the Interval type. Additionally, various new functions in GreptimeDB have been documented, covering a range of categories such as string, math, date and time, system, and admin functions.

Changes

File Change Summary
docs/.../en/reference/sql/functions/overview.md Added overview of Datafusion and GreptimeDB functions with examples.
docs/.../zh/reference/sql/functions/overview.md Added overview of Datafusion and GreptimeDB functions with multiple new entries.
docs/.../en/reference/sql/range.md Updated link to Interval type documentation.
docs/.../zh/reference/sql/range.md Updated link to Interval type documentation.

Poem

In the docs, new functions bloom,
Datafusion and GreptimeDB in full plume.
Links corrected, examples clear,
A better guide for those near.
With each command, new paths we'll roam,
In the database garden, we've found a home.
🐇✨📚


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@killme2008 killme2008 changed the title Feature/functions docs: add datafusion functions doc Jul 10, 2024
@killme2008 killme2008 marked this pull request as draft July 10, 2024 00:47
Copy link

cloudflare-pages bot commented Jul 10, 2024

Deploying greptime-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: d0036a5
Status: ✅  Deploy successful!
Preview URL: https://75dce321.greptime-docs.pages.dev
Branch Preview URL: https://feature-functions.greptime-docs.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6115840 and 3f57c09.

Files selected for processing (2)
  • docs/misc/update_functions.rb (1 hunks)
  • docs/nightly/en/reference/sql/functions.md (6 hunks)
Additional context used
GitHub Check: Run Linters
docs/nightly/en/reference/sql/functions.md

[warning] 65-65:
"Functon" should be "Function".

Additional comments not posted (3)
docs/misc/update_functions.rb (1)

73-77: LGTM!

The code changes are approved.

docs/nightly/en/reference/sql/functions.md (2)

40-40: LGTM!

The code changes are approved.


110-110: LGTM!

The code changes are approved.

docs/misc/update_functions.rb Outdated Show resolved Hide resolved
docs/misc/update_functions.rb Outdated Show resolved Hide resolved
docs/nightly/en/reference/sql/functions.md Outdated Show resolved Hide resolved
@killme2008 killme2008 marked this pull request as ready for review July 10, 2024 02:52
@killme2008 killme2008 changed the title docs: add datafusion functions doc docs: improve functions reference Jul 10, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3f57c09 and bc70c49.

Files selected for processing (5)
  • .github/workflows/linter.yml (1 hunks)
  • .typo.toml (1 hunks)
  • docs/misc/update_functions.rb (1 hunks)
  • docs/nightly/en/reference/sql/functions.md (2 hunks)
  • docs/nightly/zh/reference/sql/functions.md (1 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/linter.yml
  • .typo.toml
Files skipped from review as they are similar to previous changes (1)
  • docs/misc/update_functions.rb
Additional context used
LanguageTool
docs/nightly/en/reference/sql/functions.md

[uncategorized] ~43-~43: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...s: * matches(expression, pattern) for full text search. TODO: link to full-text searc...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[style] ~234-~234: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...he GreptimeDB build info. * version() to retrieve the GreptimeDB version. * `dat...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~235-~235: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... the GreptimeDB version. * database() to retrieve the current session database: ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~255-~255: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, plea...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~256-~256: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion). * procedure_state(procedure_id) to query a procedure state by its id. For...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

Additional comments not posted (10)
docs/nightly/zh/reference/sql/functions.md (5)

7-17: LGTM!

The translation and links for Datafusion functions are accurate and correctly updated.


45-88: LGTM!

The translation for the math functions is accurate, and the examples are correctly formatted.


91-193: LGTM!

The translation for the date and time functions is accurate, and the examples are correctly formatted.


206-230: LGTM!

The translation for the system functions is accurate, and the examples are correctly formatted.


Line range hint 243-265:
LGTM!

The translation for the admin functions is accurate, and the examples are correctly formatted.

docs/nightly/en/reference/sql/functions.md (5)

9-16: LGTM!

The updates to the links for Datafusion functions are accurate and correctly point to the new df_functions document.


47-90: LGTM!

The updates for the math functions are accurate, and the examples are correctly formatted.


93-193: LGTM!

The updates for the date and time functions are accurate, and the examples are correctly formatted.


209-230: LGTM!

The updates for the system functions are accurate, and the examples are correctly formatted.


247-265: LGTM!

The updates for the admin functions are accurate, and the examples are correctly formatted.

Tools
LanguageTool

[style] ~255-~255: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, plea...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~256-~256: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion). * procedure_state(procedure_id) to query a procedure state by its id. For...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

docs/nightly/zh/reference/sql/functions.md Outdated Show resolved Hide resolved
docs/nightly/en/reference/sql/functions.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Outside diff range, codebase verification and nitpick comments (6)
docs/nightly/zh/reference/sql/functions/overview.md (3)

3-5: Clarify the TODO note.

The TODO note is vague. Consider providing more details about the intended future changes or tidying up the content.

- The outling of this document is a little strange, as the content is classified by company functions and feature functions. We plan to tidy up the content in the future when out functions are more stable.
+ The outline of this document currently classifies functions by company and feature. We plan to reorganize the content in the future as our functions become more stable.

43-45: Clarify the TODO note.

The TODO note is vague. Consider providing more details about the intended future changes or linking to the relevant user guide.

- TODO:链接到全文检索用户指南。
+ TODO:链接到全文检索用户指南 (Link to full-text search user guide)。

231-231: Remove redundant blank line.

Remove the extra blank line between code blocks for consistency.

- ```
- 
+ ```
docs/nightly/en/reference/sql/functions/overview.md (3)

3-5: Clarify the TODO note.

The TODO note is vague. Consider providing more details about the intended future changes or tidying up the content.

- The outling of this document is a little strange, as the content is classified by company functions and feature functions. We plan to tidy up the content in the future when out functions are more stable.
+ The outline of this document currently classifies functions by company and feature. We plan to reorganize the content in the future as our functions become more stable.

43-45: Clarify the TODO note.

The TODO note is vague. Consider providing more details about the intended future changes or linking to the relevant user guide.

- TODO: link to full-text searching user guide.
+ TODO: link to full-text searching user guide (Link to full-text search user guide).
Tools
LanguageTool

[uncategorized] ~43-~43: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...s: * matches(expression, pattern) for full text search. TODO: link to full-text searc...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


231-231: Remove redundant blank line.

Remove the extra blank line between code blocks for consistency.

- ```
- 
+ ```
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bc70c49 and 5be7a0a.

Files selected for processing (18)
  • .typo.toml (1 hunks)
  • docs/misc/update_functions.rb (1 hunks)
  • docs/nightly/en/faq-and-others/faq.md (1 hunks)
  • docs/nightly/en/reference/sql/functions/overview.md (1 hunks)
  • docs/nightly/en/reference/sql/group_by.md (1 hunks)
  • docs/nightly/en/reference/sql/overview.md (1 hunks)
  • docs/nightly/en/reference/sql/range.md (1 hunks)
  • docs/nightly/en/summary.yml (2 hunks)
  • docs/nightly/en/user-guide/operations/admin.md (1 hunks)
  • docs/nightly/en/user-guide/query-data/sql.md (2 hunks)
  • docs/nightly/zh/faq-and-others/faq.md (1 hunks)
  • docs/nightly/zh/reference/sql/functions/overview.md (1 hunks)
  • docs/nightly/zh/reference/sql/group_by.md (1 hunks)
  • docs/nightly/zh/reference/sql/overview.md (1 hunks)
  • docs/nightly/zh/reference/sql/range.md (1 hunks)
  • docs/nightly/zh/summary-i18n.yml (1 hunks)
  • docs/nightly/zh/user-guide/operations/admin.md (1 hunks)
  • docs/nightly/zh/user-guide/query-data/sql.md (2 hunks)
Files skipped from review due to trivial changes (14)
  • docs/nightly/en/faq-and-others/faq.md
  • docs/nightly/en/reference/sql/group_by.md
  • docs/nightly/en/reference/sql/overview.md
  • docs/nightly/en/reference/sql/range.md
  • docs/nightly/en/summary.yml
  • docs/nightly/en/user-guide/operations/admin.md
  • docs/nightly/en/user-guide/query-data/sql.md
  • docs/nightly/zh/faq-and-others/faq.md
  • docs/nightly/zh/reference/sql/group_by.md
  • docs/nightly/zh/reference/sql/overview.md
  • docs/nightly/zh/reference/sql/range.md
  • docs/nightly/zh/summary-i18n.yml
  • docs/nightly/zh/user-guide/operations/admin.md
  • docs/nightly/zh/user-guide/query-data/sql.md
Files skipped from review as they are similar to previous changes (2)
  • .typo.toml
  • docs/misc/update_functions.rb
Additional context used
LanguageTool
docs/nightly/en/reference/sql/functions/overview.md

[uncategorized] ~43-~43: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...s: * matches(expression, pattern) for full text search. TODO: link to full-text searc...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[style] ~234-~234: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...he GreptimeDB build info. * version() to retrieve the GreptimeDB version. * `dat...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~235-~235: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... the GreptimeDB version. * database() to retrieve the current session database: ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~255-~255: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, plea...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~256-~256: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion). * procedure_state(procedure_id) to query a procedure state by its id. For...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

Additional comments not posted (9)
docs/nightly/zh/reference/sql/functions/overview.md (5)

15-15: Fix broken link.

The link to DataFusion functions should use a hyphen instead of an underscore.

- 要查找所有 DataFusion 函数,请参阅 [DataFusion 函数](./df-functions)。
+ 要查找所有 DataFusion 函数,请参阅 [DataFusion 函数](./df_functions)。

Likely invalid or redundant comment.


11-13: Fix broken links.

The links to the function categories should use hyphens instead of underscores.

- * **聚合函数**: 如 `COUNT`、`SUM`、`MIN`、`MAX` 等。详细列表请参阅 [聚合函数](./df-functions#aggregate-functions)
- * **标量函数**: 如 `ABS`、`COS`、`FLOOR` 等。详细列表请参阅 [标量函数](./df-functions#scalar-functions)
- * **窗口函数**: 对相关的一组行记录执行计算。详细列表请参阅 [窗口函数](./df-functions#window-functions)
+ * **聚合函数**: 如 `COUNT`、`SUM`、`MIN`、`MAX` 等。详细列表请参阅 [聚合函数](./df_functions#aggregate-functions)
+ * **标量函数**: 如 `ABS`、`COS`、`FLOOR` 等。详细列表请参阅 [标量函数](./df_functions#scalar-functions)
+ * **窗口函数**: 对相关的一组行记录执行计算。详细列表请参阅 [窗口函数](./df_functions#window-functions)

Likely invalid or redundant comment.


43-43: Use a hyphen for compound adjectives.

The term "full text search" should be hyphenated as "full-text search".

- * `matches(expression, pattern)` 用于全文检索。
+ * `matches(expression, pattern)` 用于全文检索 (full-text search)。

Likely invalid or redundant comment.


93-93: Fix broken link.

The link to time and date functions should use a hyphen instead of an underscore.

- DataFusion [时间和日期函数](./df-functions#time-and-date-functions)。GreptimeDB 额外提供:
+ DataFusion [时间和日期函数](./df_functions#time-and-date-functions)。GreptimeDB 额外提供:

Likely invalid or redundant comment.


47-47: Fix broken link.

The link to math functions should use a hyphen instead of an underscore.

- DataFusion [数学函数](./df-functions#math-functions)。GreptimeDB 额外提供:
+ DataFusion [数学函数](./df_functions#math-functions)。GreptimeDB 额外提供:

Likely invalid or redundant comment.

docs/nightly/en/reference/sql/functions/overview.md (4)

95-95: Fix broken link.

The link to time and date functions should use a hyphen instead of an underscore.

- DataFusion [Time and Date Function](./df-functions#time-and-date-functions).
+ DataFusion [Time and Date Function](./df_functions#time-and-date-functions).

Likely invalid or redundant comment.


12-14: Fix broken links.

The links to the function categories should use hyphens instead of underscores.

- * **Aggregate functions**: such as `COUNT`, `SUM`, `MIN`, `MAX`, etc. For a detailed list, please refer to [Aggregate Functions](./df-functions#aggregate-functions)
- * **Scalar functions**: such as `ABS`, `COS`, `FLOOR`, etc. For a detailed list, please refer to [Scalar Functions](./df-functions#scalar-functions)
- * **Window functions**: performs a calculation across a set of table rows that are somehow related to the current row. For a detailed list, please refer to [Window Functions](./df-functions#window-functions)
+ * **Aggregate functions**: such as `COUNT`, `SUM`, `MIN`, `MAX`, etc. For a detailed list, please refer to [Aggregate Functions](./df_functions#aggregate-functions)
+ * **Scalar functions**: such as `ABS`, `COS`, `FLOOR`, etc. For a detailed list, please refer to [Scalar Functions](./df_functions#scalar-functions)
+ * **Window functions**: performs a calculation across a set of table rows that are somehow related to the current row. For a detailed list, please refer to [Window Functions](./df_functions#window-functions)

Likely invalid or redundant comment.


255-255: Fix broken link.

The link to the region migration guide should use hyphens instead of underscores.

- * `migrate_region(region_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, please read the [Region Migration](/user-guide/operations/region-migration).
+ * `migrate_region(region_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, please read the [Region Migration](/user_guide/operations/region_migration).

Likely invalid or redundant comment.

Tools
LanguageTool

[style] ~255-~255: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, plea...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


49-49: Fix broken link.

The link to math functions should use a hyphen instead of an underscore.

- DataFusion [Math Function](./df-functions#math-functions).GreptimeDB provides:
+ DataFusion [Math Function](./df_functions#math-functions).GreptimeDB provides:

Likely invalid or redundant comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5be7a0a and 99d47d2.

Files selected for processing (2)
  • CONTRIBUTING.md (4 hunks)
  • docs/misc/update_functions.rb (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • docs/misc/update_functions.rb
Additional comments not posted (5)
CONTRIBUTING.md (5)

Line range hint 3-12:
LGTM!

The "File structure" section changes are clear and concise.


14-20: LGTM!

The "Document localization" section changes are clear and concise.


21-23: LGTM!

The "Links" section changes are clear and concise.


25-35: LGTM!

The new "Update df-functions.md" section provides clear and concise instructions for updating the file.


Line range hint 71-82:
LGTM!

The "Preview the localized documentation" section provides clear and concise instructions for previewing the documentation in a specific language.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 99d47d2 and 219801c.

Files selected for processing (1)
  • docs/nightly/en/reference/sql/functions/overview.md (1 hunks)
Additional context used
LanguageTool
docs/nightly/en/reference/sql/functions/overview.md

[uncategorized] ~43-~43: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...s: * matches(expression, pattern) for full text search. <!-- TODO: link to full-text ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[style] ~234-~234: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...he GreptimeDB build info. * version() to retrieve the GreptimeDB version. * `dat...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~235-~235: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... the GreptimeDB version. * database() to retrieve the current session database: ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~255-~255: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, plea...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~256-~256: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion). * procedure_state(procedure_id) to query a procedure state by its id. For...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

Additional comments not posted (4)
docs/nightly/en/reference/sql/functions/overview.md (4)

16-16: Fix broken link.

The link to DataFusion functions should use an underscore instead of a hyphen.

- To find all the DataFusion functions, please refer to [DataFusion Functions](./df-functions).
+ To find all the DataFusion functions, please refer to [DataFusion Functions](./df_functions).

43-43: Use a hyphen for compound adjectives.

The term "full text search" should be hyphenated as "full-text search".

- * `matches(expression, pattern)` for full text search.
+ * `matches(expression, pattern)` for full-text search.
Tools
LanguageTool

[uncategorized] ~43-~43: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...s: * matches(expression, pattern) for full text search. <!-- TODO: link to full-text ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


23-23: Fix broken link.

The link to the arrow_cast function should use an underscore instead of a hyphen.

- `arrow_cast` function is from DataFusion's [`arrow_cast`](./df-functions#arrow-cast). It's illustrated as:
+ `arrow_cast` function is from DataFusion's [`arrow_cast`](./df_functions#arrow-cast). It's illustrated as:

Likely invalid or redundant comment.


95-95: Fix broken link.

The link to the Time and Date Function should use an underscore instead of a hyphen.

- DataFusion [Time and Date Function](./df-functions#time-and-date-functions).
+ DataFusion [Time and Date Function](./df_functions#time-and-date-functions).

Likely invalid or redundant comment.

docs/nightly/en/reference/sql/functions/overview.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 219801c and 96d596a.

Files selected for processing (2)
  • docs/nightly/en/reference/sql/functions/overview.md (1 hunks)
  • docs/nightly/zh/reference/sql/functions/overview.md (1 hunks)
Additional context used
LanguageTool
docs/nightly/en/reference/sql/functions/overview.md

[uncategorized] ~40-~40: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...s: * matches(expression, pattern) for full text search. <!-- TODO: link to full-text ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[style] ~231-~231: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...he GreptimeDB build info. * version() to retrieve the GreptimeDB version. * `dat...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~232-~232: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... the GreptimeDB version. * database() to retrieve the current session database: ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~252-~252: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, plea...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~253-~253: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion). * procedure_state(procedure_id) to query a procedure state by its id. For...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

Additional comments not posted (16)
docs/nightly/zh/reference/sql/functions/overview.md (7)

17-32: LGTM!

The documentation for the arrow_cast function is clear and includes necessary details and examples.


39-40: LGTM!

The documentation for the matches function is clear and includes necessary details.


46-87: LGTM!

The documentation for the clamp, mod, and pow functions is clear and includes necessary details and examples.


91-202: LGTM!

The documentation for the date_add, date_sub, date_format, to_unixtime, to_timezone, and timezone functions is clear and includes necessary details and examples.


206-227: LGTM!

The documentation for the isnull function is clear and includes necessary details and examples.


243-250: LGTM!

The documentation for the flush_table, flush_region, compact_table, compact_region, and procedure_state functions is clear and includes necessary details.


Line range hint 255-261:
LGTM!

The examples for the flush_table and compact_table functions are clear and correctly demonstrate the usage.

docs/nightly/en/reference/sql/functions/overview.md (9)

18-32: LGTM!

The documentation for the arrow_cast function is clear and includes necessary details and examples.


39-40: LGTM!

The documentation for the matches function is clear and includes necessary details.

Tools
LanguageTool

[uncategorized] ~40-~40: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...s: * matches(expression, pattern) for full text search. <!-- TODO: link to full-text ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


46-87: LGTM!

The documentation for the clamp, mod, and pow functions is clear and includes necessary details and examples.


91-202: LGTM!

The documentation for the date_add, date_sub, date_format, to_unixtime, to_timezone, and timezone functions is clear and includes necessary details and examples.


206-227: LGTM!

The documentation for the isnull function is clear and includes necessary details and examples.


243-253: LGTM!

The documentation for the flush_table, flush_region, compact_table, compact_region, migrate_region, and procedure_state functions is clear and includes necessary details.

Tools
LanguageTool

[style] ~252-~252: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, plea...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~253-~253: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion). * procedure_state(procedure_id) to query a procedure state by its id. For...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


255-261: LGTM!

The examples for the flush_table and compact_table functions are clear and correctly demonstrate the usage.


46-46: Fix broken link.

The link to the Math Function should use an underscore instead of a hyphen.

- DataFusion [Math Function](./df-functions#math-functions).GreptimeDB provides:
+ DataFusion [Math Function](./df_functions#math-functions).GreptimeDB provides:

Likely invalid or redundant comment.


16-16: Fix broken link.

The link to DataFusion functions should use a hyphen instead of an underscore.

- To find all the DataFusion functions, please refer to [DataFusion Functions](./df-functions).
+ To find all the DataFusion functions, please refer to [DataFusion Functions](./df_functions).

Likely invalid or redundant comment.

@killme2008
Copy link
Contributor Author

I don't recommend translating docs/nightly/zh/reference/sql/functions/df-functions.md, it can't be auto-generated and may be confused. The function in English is suitable and precise. @nicecui

docs/nightly/en/reference/sql/range.md Outdated Show resolved Hide resolved
docs/nightly/zh/reference/sql/range.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Outside diff range, codebase verification and nitpick comments (4)
docs/nightly/zh/reference/sql/functions/overview.md (2)

206-225: Ensure consistent formatting for SQL examples.

The SQL examples should have consistent formatting and spacing.

- SELECT isnull(1);
- 
- +------------------+
- | isnull(Int64(1)) |
- +------------------+
- |                0 |
- +------------------+
+ ```sql
+ SELECT isnull(1);
+ ```
+ 
+ ```
+ +------------------+
+ | isnull(Int64(1)) |
+ +------------------+
+ |                0 |
+ +------------------+
+ ```
- SELECT isnull(NULL);
- 
- +--------------+
- | isnull(NULL) |
- +--------------+
- |            1 |
- +--------------+
+ ```sql
+ SELECT isnull(NULL);
+ ```
+ 
+ ```
+ +--------------+
+ | isnull(NULL) |
+ +--------------+
+ |            1 |
+ +--------------+
+ ```

249-250: Fix formatting for function descriptions.

Ensure consistent formatting for function descriptions.

- GreptimeDB 提供一些管理数据库和数据的函数:
+ GreptimeDB 提供一些管理数据库和数据的函数:
+ 
+ * `flush_table(table_name)` 通过表名将表的内存表刷写到 SST 文件。
+ * `flush_region(region_id)` 通过 Region Id 将 Region 的内存表刷写到 SST 文件。可以通过 [PARTITIONS](../information-schema/partitions.md) 表查找一张表的所有 Region Id。
+ * `compact_table(table_name)` 通过表名为表发起compaction 任务。
+ * `compact_region(region_id)` 通过 Region Id 为 Region 发起 compaction 任务。
+ * `migrate_region(region_id, from_peer, to_peer, [timeout])` 在 Datanode 之间迁移 Region,请阅读 [ Region迁移](/user-guide/operations/region-migration)。
+ * `procedure_state(procedure_id)` 通过 Procedure Id 查询 Procedure 状态。
docs/nightly/en/reference/sql/functions/overview.md (2)

212-231: Ensure consistent formatting for SQL examples.

The SQL examples should have consistent formatting and spacing.

- SELECT isnull(1);
- 
- +------------------+
- | isnull(Int64(1)) |
- +------------------+
- |                0 |
- +------------------+
+ ```sql
+ SELECT isnull(1);
+ ```
+ 
+ ```
+ +------------------+
+ | isnull(Int64(1)) |
+ +------------------+
+ |                0 |
+ +------------------+
+ ```
- SELECT isnull(NULL);
- 
- +--------------+
- | isnull(NULL) |
- +--------------+
- |            1 |
- +--------------+
+ ```sql
+ SELECT isnull(NULL);
+ ```
+ 
+ ```
+ +--------------+
+ | isnull(NULL) |
+ +--------------+
+ |            1 |
+ +--------------+
+ ```

250-257: Fix formatting for function descriptions.

Ensure consistent formatting for function descriptions.

- GreptimeDB provides some administration functions to manage the database and data:
+ GreptimeDB provides some administration functions to manage the database and data:
+ 
+ * `flush_table(table_name)` to flush a table's memtables into SST file by table name.
+ * `flush_region(region_id)` to flush a region's memtables into SST file by region id. Find the region id through [PARTITIONS](../information-schema/partitions.md) table.
+ * `compact_table(table_name)` to schedule a compaction task for a table by table name.
+ * `compact_region(region_id)` to schedule a compaction task for a region by region id.
+ * `migrate_region(region_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, please read the [Region Migration](/user-guide/operations/region-migration).
+ * `procedure_state(procedure_id)` to query a procedure state by its id.
Tools
LanguageTool

[style] ~256-~256: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, plea...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~257-~257: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion). * procedure_state(procedure_id) to query a procedure state by its id. For...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 219801c and d0036a5.

Files selected for processing (4)
  • docs/nightly/en/reference/sql/functions/overview.md (1 hunks)
  • docs/nightly/en/reference/sql/range.md (1 hunks)
  • docs/nightly/zh/reference/sql/functions/overview.md (1 hunks)
  • docs/nightly/zh/reference/sql/range.md (1 hunks)
Files skipped from review due to trivial changes (2)
  • docs/nightly/en/reference/sql/range.md
  • docs/nightly/zh/reference/sql/range.md
Additional context used
LanguageTool
docs/nightly/en/reference/sql/functions/overview.md

[uncategorized] ~40-~40: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...s: * matches(expression, pattern) for full text search. <!-- TODO: link to full-text ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[style] ~236-~236: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... the GreptimeDB version. * database() retrieves the current session database: ```sql s...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~256-~256: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, plea...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~257-~257: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion). * procedure_state(procedure_id) to query a procedure state by its id. For...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

Additional comments not posted (8)
docs/nightly/zh/reference/sql/functions/overview.md (4)

11-13: Fix broken links.

The links to DataFusion functions should use an underscore instead of a hyphen to match the file names.

- * **聚合函数**: 如 `COUNT`、`SUM`、`MIN`、`MAX` 等。详细列表请参阅 [聚合函数](./df-functions#aggregate-functions)
- * **标量函数**: 如 `ABS`、`COS`、`FLOOR` 等。详细列表请参阅 [标量函数](./df-functions#scalar-functions)
- * **窗口函数**: 对相关的一组行记录执行计算。详细列表请参阅 [窗口函数](./df-functions#window-functions)
+ * **聚合函数**: 如 `COUNT`、`SUM`、`MIN`、`MAX` 等。详细列表请参阅 [聚合函数](./df_functions#aggregate-functions)
+ * **标量函数**: 如 `ABS`、`COS`、`FLOOR` 等。详细列表请参阅 [标量函数](./df_functions#scalar-functions)
+ * **窗口函数**: 对相关的一组行记录执行计算。详细列表请参阅 [窗口函数](./df_functions#window-functions)

15-15: Fix broken link.

The link to DataFusion functions should use an underscore instead of a hyphen.

- 要查看所有 DataFusion 函数,请参阅 [DataFusion 函数](./df-functions)。
+ 要查看所有 DataFusion 函数,请参阅 [DataFusion 函数](./df_functions)。

45-45: Fix broken link.

The link to the Math Function should use an underscore instead of a hyphen.

- DataFusion [数学函数](./df-functions#math-functions)。GreptimeDB 额外提供:
+ DataFusion [数学函数](./df_functions#math-functions)。GreptimeDB 额外提供:

91-91: Fix broken link.

The link to the Time and Date Function should use an underscore instead of a hyphen.

- DataFusion [时间和日期函数](./df-functions#time-and-date-functions)。GreptimeDB 额外提供:
+ DataFusion [时间和日期函数](./df_functions#time-and-date-functions)。GreptimeDB 额外提供:
docs/nightly/en/reference/sql/functions/overview.md (4)

12-14: Fix broken links.

The links to DataFusion functions should use an underscore instead of a hyphen to match the file names.

- * **Aggregate functions**: such as `COUNT`, `SUM`, `MIN`, `MAX`, etc. For a detailed list, please refer to [Aggregate Functions](./df-functions#aggregate-functions)
- * **Scalar functions**: such as `ABS`, `COS`, `FLOOR`, etc. For a detailed list, please refer to [Scalar Functions](./df-functions#scalar-functions)
- * **Window functions**: performs a calculation across a set of table rows that are somehow related to the current row. For a detailed list, please refer to [Window Functions](./df-functions#window-functions)
+ * **Aggregate functions**: such as `COUNT`, `SUM`, `MIN`, `MAX`, etc. For a detailed list, please refer to [Aggregate Functions](./df_functions#aggregate-functions)
+ * **Scalar functions**: such as `ABS`, `COS`, `FLOOR`, etc. For a detailed list, please refer to [Scalar Functions](./df_functions#scalar-functions)
+ * **Window functions**: performs a calculation across a set of table rows that are somehow related to the current row. For a detailed list, please refer to [Window Functions](./df_functions#window-functions)

16-16: Fix broken link.

The link to DataFusion functions should use an underscore instead of a hyphen.

- To find all the DataFusion functions, please refer to [DataFusion Functions](./df-functions).
+ To find all the DataFusion functions, please refer to [DataFusion Functions](./df_functions).

46-46: Fix broken link.

The link to the Math Function should use an underscore instead of a hyphen.

- DataFusion [Math Function](./df-functions#math-functions).
+ DataFusion [Math Function](./df_functions#math-functions).

96-96: Fix broken link.

The link to the Time and Date Function should use an underscore instead of a hyphen.

- DataFusion [Time and Date Function](./df-functions#time-and-date-functions).
+ DataFusion [Time and Date Function](./df_functions#time-and-date-functions).

DataFusion [字符串函数](./df-functions#string-functions)。GreptimeDB 提供:
* `matches(expression, pattern)` 用于全文检索。

TODO:链接到全文检索用户指南。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder: Add link to full-text searching user guide.

The TODO comment indicates that a link to the full-text searching user guide is missing.

Do you want me to generate the link or open a GitHub issue to track this task?

DataFusion [String Function](./df-functions#string-functions).GreptimeDB provides:
* `matches(expression, pattern)` for full text search.

<!-- TODO: link to full-text searching user guide. -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder: Add link to full-text searching user guide.

The TODO comment indicates that a link to the full-text searching user guide is missing.

Do you want me to generate the link or open a GitHub issue to track this task?

@killme2008 killme2008 merged commit bbe2608 into main Jul 10, 2024
5 checks passed
@killme2008 killme2008 deleted the feature/functions branch July 10, 2024 18:46
killme2008 added a commit that referenced this pull request Jul 22, 2024
Co-authored-by: Yiran <cuiyiran3@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants