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: add docs for the merge_mode option #1061

Merged
merged 2 commits into from
Jul 16, 2024
Merged

docs: add docs for the merge_mode option #1061

merged 2 commits into from
Jul 16, 2024

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented Jul 15, 2024

What's Changed in this PR

This PR adds docs for the newly added merge_mode table option.

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

  • New Features

    • Introduced merge_mode for table creation in GreptimeDB, allowing partial field updates and enhanced data duplication management.
    • Added new merge strategies: last_row and last_non_null to manage duplicate rows in tables with append_mode.
  • Documentation

    • Updated documentation to reflect new merge_mode functionality and its impact on table creation syntax.

@evenyag evenyag requested review from nicecui and a team as code owners July 15, 2024 12:05
Copy link
Contributor

coderabbitai bot commented Jul 15, 2024

Walkthrough

The recent updates to GreptimeDB documentation introduce a new feature called merge_mode for table creation. This feature allows users to specify how duplicate rows are handled, providing options to either keep the latest row or the latest non-null field for duplicate primary key and timestamp combinations. These additions enhance flexibility in managing data duplication and partial updates.

Changes

File Change Summary
docs/.../reference/sql/compatibility.md Added support for merge_mode, allowing partial updates in addition to append mode.
docs/.../reference/sql/create.md Enhanced table creation with merge_mode for append_mode, introducing last_row and last_non_null strategies.
docs/.../reference/sql/compatibility.md (ZH) Introduced merge_mode for partial field updates in GreptimeDB.
docs/.../reference/sql/create.md (ZH) Updated table creation syntax with merge_mode, providing strategies for handling duplicate rows in append_mode.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GreptimeDB

    User->>GreptimeDB: Create Table with append_mode and merge_mode
    Note over GreptimeDB: Validate append_mode and merge_mode
    GreptimeDB-->>User: Table Created

    User->>GreptimeDB: Insert Data
    Note over GreptimeDB: Check for duplicate primary key and timestamp
    alt append_mode is false
        alt merge_mode is last_row
            GreptimeDB-->>User: Keep the last row
        else merge_mode is last_non_null
            GreptimeDB-->>User: Keep the last non-null field
        end
    else append_mode is true
        GreptimeDB-->>User: Keep duplicate rows
    end
Loading

Possibly related issues

Poem

In the realm of data's flight,
GreptimeDB sets things right.
With merge_mode now in sight,
Rows merge softly, day and night.
Append, update, fields unite,
Bringing database delight.
🌟🗃️✨


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.

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

Outside diff range, codebase verification and nitpick comments (1)
docs/nightly/en/reference/sql/compatibility.md (1)

12-12: Fix grammatical error.

Add a comma after "option" to improve readability.

-   * GreptimeDB supports [merge mode](/reference/sql/create#create-an-append-only-table) that creates a table with `merge_mode="last_non_null"` option which allow updating a field partially.
+   * GreptimeDB supports [merge mode](/reference/sql/create#create-an-append-only-table) that creates a table with `merge_mode="last_non_null"` option, which allows updating a field partially.
Tools
LanguageTool

[uncategorized] ~12-~12: Possible missing comma found.
Context: ...table with merge_mode="last_non_null" option which allow updating a field partially....

(AI_HYDRA_LEO_MISSING_COMMA)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between aa2f2ae and 20dbc54.

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

[uncategorized] ~12-~12: Possible missing comma found.
Context: ...table with merge_mode="last_non_null" option which allow updating a field partially....

(AI_HYDRA_LEO_MISSING_COMMA)

Additional comments not posted (3)
docs/nightly/en/reference/sql/create.md (3)

101-101: LGTM!

The description of the append_mode option is clear and accurate.


102-102: LGTM!

The description of the merge_mode option is clear and accurate.


153-211: LGTM!

The examples for creating tables with different merge_mode settings are clear and well-structured.

Copy link

cloudflare-workers-and-pages bot commented Jul 15, 2024

Deploying greptime-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: dd12a34
Status: ✅  Deploy successful!
Preview URL: https://3f1a9077.greptime-docs.pages.dev
Branch Preview URL: https://docs-merge-mode.greptime-docs.pages.dev

View logs

@nicecui nicecui requested a review from fengjiachun July 15, 2024 12:48
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 20dbc54 and dd12a34.

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

[uncategorized] ~172-~172: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:最新"地"行
Context: ...st_row'); 在 `last_row` 模式下,表会通过保留最新的行来合并具有相同主键和时间戳的行。 sql INSERT INTO me...

(wb4)

Additional comments not posted (4)
docs/nightly/zh/reference/sql/create.md (4)

103-103: LGTM! Verify the consistency of the description.

The updated description for append_mode correctly reflects the new behavior with merge_mode. Ensure that similar descriptions in other parts of the documentation are consistent.


104-104: LGTM! Verify the accuracy of the description.

The added description for merge_mode is clear and accurately describes the new feature. Ensure that the behavior matches the implementation.


155-186: LGTM! Verify the examples and explanations.

The new section for creating tables with merge_mode is clear and provides useful examples. Ensure that the examples are accurate and match the expected behavior.

Tools
LanguageTool

[uncategorized] ~172-~172: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:最新"地"行
Context: ...st_row'); 在 `last_row` 模式下,表会通过保留最新的行来合并具有相同主键和时间戳的行。 sql INSERT INTO me...

(wb4)


189-218: LGTM! Verify the example's accuracy.

The new example for creating tables with merge_mode set to last_non_null is clear and provides a useful demonstration. Ensure that the example is accurate and matches the expected behavior.

@nicecui nicecui merged commit c7b4f8a into main Jul 16, 2024
5 checks passed
@nicecui nicecui deleted the docs/merge-mode branch July 16, 2024 01:56
killme2008 pushed 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.

3 participants