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

feat: impl create dynamic table sql parser and planner #15250

Merged
merged 3 commits into from
Apr 20, 2024

Conversation

zhyass
Copy link
Member

@zhyass zhyass commented Apr 17, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  1. impl create dynamic table semantics
  2. impl semantic check binder
  3. unit-test around create dynamic table semantics

Syntax

CREATE [OR REPLACE] [TRANSIENT] DYNAMIC TABLE [ IF NOT EXISTS ] [<database>.]<table> [<source>]
  [ CLUSTER BY <expr> ]
  TARGET_LAG = { <num> { SECOND | MINUTE | HOUR | DAY }  | DOWNSTREAM }
  [ { WAREHOUSE = <string> } ]
  [ REFRESH_MODE = { AUTO | FULL | INCREMENTAL } ]
  [ INITIALIZE = { ON_CREATE | ON_SCHEDULE } ]
  [ COMMENT = '<string_literal>' ]
AS
  <sql>
Parameter Required/Optional Description
TARGET_LAG Required Specifies the lag for the dynamic table.
DOWNSTREAM: Specifies that the dynamic table should be refreshed only when dynamic tables that depend on it are refreshed.
TRANSIENT Optional Specifies that the dynamic table is transient.
WAREHOUSE Optional Specifies the name of the warehouse.
REFRESH_MODE Optional Specifies therefresh mode for the dynamic table.
AUTO: Default, check the dynamic table, if support incremental refresh mode, then will be incremental.
FULL: Enforces a full refresh of the dynamic table.
INCREMENTAL: Enforces an incremental refresh of the dynamic table.
INITIALIZE Optional Specifies the behavior of the initial refresh of the dynamic table.
ON_CREATE: Default, Initial Refreshes the dynamic table at creation.
ON_SCHEDULE: Initial Refreshes the dynamic table at schedule.
sql Required Specifies the query that will be executed to result the dynamic table
  • Fixes #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@zhyass zhyass marked this pull request as draft April 17, 2024 04:32
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Apr 17, 2024
@zhyass zhyass marked this pull request as ready for review April 19, 2024 03:30
@zhyass zhyass requested review from flaneur2020 and removed request for sundy-li April 19, 2024 03:30
@zhyass zhyass marked this pull request as draft April 19, 2024 04:56
@zhyass zhyass marked this pull request as ready for review April 19, 2024 17:30
@zhyass zhyass marked this pull request as draft April 19, 2024 18:04
@zhyass zhyass marked this pull request as ready for review April 19, 2024 18:31
@zhyass zhyass requested a review from sundy-li April 20, 2024 02:54
@zhyass zhyass mentioned this pull request Apr 20, 2024
1 task
@zhyass zhyass added this pull request to the merge queue Apr 20, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Apr 20, 2024
@BohuTANG BohuTANG merged commit b1b622d into databendlabs:main Apr 20, 2024
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants