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

[spark] Add tag ddl sytnax for create/delete/rename tag #4329

Merged
merged 5 commits into from
Oct 29, 2024

Conversation

askwang
Copy link
Contributor

@askwang askwang commented Oct 15, 2024

Purpose

Linked issue: close #xxx

Tests

API and Format

Documentation

### Create Tag
Create a tag based on snapshot or retention.
```sql
-- create a tag based on lastest snapshot and no retention.
Copy link
Contributor

Choose a reason for hiding this comment

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

lastest -> the latest

-- create a tag based on lastest snapshot and no retention.
ALTER TABLE T CREATE TAG `TAG-1`;

-- create a tag based on lastest snapshot and no retention if it doesn't exist.
Copy link
Contributor

Choose a reason for hiding this comment

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

lastest -> the latest

-- create a tag based on lastest snapshot and no retention if it doesn't exist.
ALTER TABLE T CREATE TAG IF NOT EXISTS `TAG-1`;

-- create a tag based on lastest snapshot and retain it for 7 day.
Copy link
Contributor

Choose a reason for hiding this comment

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

lastest -> the latest

-- create a tag based on lastest snapshot and retain it for 7 day.
ALTER TABLE T CREATE TAG `TAG-2` RETAIN 7 DAYS;

-- create a tag based on snapshot 1 and no retention.
Copy link
Contributor

Choose a reason for hiding this comment

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

snapshot-1

-- create a tag based on snapshot 1 and no retention.
ALTER TABLE T CREATE TAG `TAG-3` AS OF VERSION 1;

-- create a tag based on snapshot 2 and retain it for 12 hour.
Copy link
Contributor

Choose a reason for hiding this comment

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

snapshot-2

* @param number a digital number
* @param unitLabel time unit label
*/
public static Duration parseDuration(Long number, String unitLabel) {
Copy link
Contributor

Choose a reason for hiding this comment

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

long number

*/
public static Duration parseDuration(Long number, String unitLabel) {
ChronoUnit unit = LABEL_TO_UNIT_MAP.get(unitLabel.toLowerCase(Locale.US));
if (unit != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

checkNotNull(xxx);
return Duration.of(number, unit);

@askwang
Copy link
Contributor Author

askwang commented Oct 17, 2024

addressed, thanks @wwj6591812

@askwang askwang closed this Oct 21, 2024
@askwang askwang reopened this Oct 21, 2024
@wwj6591812
Copy link
Contributor

+1

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 3ed17b1 into apache:master Oct 29, 2024
13 checks passed
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