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

fix: allow passing extra table options #3484

Merged
merged 8 commits into from Mar 12, 2024

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented Mar 11, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

fixes #3476

What's changed and what's your intention?

This PR removes the validation for table options in the create parser as different engine might require different extra options.

Now we can specify engine related options via with statement. The following statement sets compaction time window to 1 day.

CREATE TABLE IF NOT EXISTS `test_table` (
    `ts` TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(),
    `id` INT NULL,
    `content` STRING NULL,
    TIME INDEX (`ts`),
    PRIMARY KEY (`id`)
)
ENGINE=mito
WITH(
    'compaction.type' = 'twcs',
    'compaction.twcs.time_window' = '1d',
    regions = 1
);

Note that compaction.type is required if we want to set compaction options.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Mar 11, 2024
@evenyag evenyag marked this pull request as ready for review March 11, 2024 09:34
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 98.26087% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 85.01%. Comparing base (0a4444a) to head (dc3f592).

❗ Current head dc3f592 differs from pull request most recent head c139b81. Consider uploading reports for the commit c139b81 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3484      +/-   ##
==========================================
- Coverage   85.42%   85.01%   -0.41%     
==========================================
  Files         898      899       +1     
  Lines      148395   148476      +81     
==========================================
- Hits       126768   126233     -535     
- Misses      21627    22243     +616     

Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

@killme2008 killme2008 added this pull request to the merge queue Mar 12, 2024
Merged via the queue into GreptimeTeam:main with commit 9aa8f75 Mar 12, 2024
16 checks passed
@evenyag evenyag deleted the fix/allow-extra-opts branch March 12, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to specify extra table options in CREATE TABLE statement
3 participants