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: alter database ttl #203

Merged
merged 5 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,925 changes: 1,430 additions & 495 deletions c++/greptime/v1/ddl.pb.cc

Large diffs are not rendered by default.

2,102 changes: 1,574 additions & 528 deletions c++/greptime/v1/ddl.pb.h

Large diffs are not rendered by default.

406 changes: 347 additions & 59 deletions c++/greptime/v1/meta/ddl.pb.cc

Large diffs are not rendered by default.

404 changes: 376 additions & 28 deletions c++/greptime/v1/meta/ddl.pb.h

Large diffs are not rendered by default.

1,250 changes: 767 additions & 483 deletions go/greptime/v1/ddl.pb.go

Large diffs are not rendered by default.

475 changes: 282 additions & 193 deletions go/greptime/v1/meta/ddl.pb.go

Large diffs are not rendered by default.

1,044 changes: 960 additions & 84 deletions java/src/main/java/greptime/v1/meta/Ddl.java

Large diffs are not rendered by default.

5,768 changes: 4,363 additions & 1,405 deletions java/src/main/java/io/greptime/v1/Ddl.java

Large diffs are not rendered by default.

32 changes: 25 additions & 7 deletions proto/greptime/v1/ddl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ message DdlRequest {
oneof expr {
CreateDatabaseExpr create_database = 1;
CreateTableExpr create_table = 2;
AlterExpr alter = 3;
AlterTableExpr alter_table = 3;
DropTableExpr drop_table = 4;
TruncateTableExpr truncate_table = 7;
CreateFlowExpr create_flow = 8;
DropFlowExpr drop_flow = 9;
CreateViewExpr create_view = 10;
DropViewExpr drop_view = 11;
AlterDatabaseExpr alter_database = 12;
}
}

Expand Down Expand Up @@ -100,7 +101,7 @@ message CreateTableExpr {
string engine = 12;
}

message AlterExpr {
message AlterTableExpr {
string catalog_name = 1;
string schema_name = 2;
string table_name = 3;
Expand Down Expand Up @@ -163,15 +164,15 @@ message ModifyColumnType {
ColumnDataTypeExtension target_type_extension = 3;
}

message SetTableOptions {
repeated TableOption table_options = 1;
}

message TableOption {
message Option {
string key = 1;
string value = 2;
}

message SetTableOptions {
repeated Option table_options = 1;
}

message UnsetTableOptions {
repeated string keys = 1;
}
Expand Down Expand Up @@ -221,3 +222,20 @@ message SetColumnFulltext {
message UnsetColumnFulltext {
string column_name = 1;
}

message AlterDatabaseExpr {
string catalog_name = 1;
string schema_name = 2;
oneof kind {
SetDatabaseOptions set_database_options = 3;
UnsetDatabaseOptions unset_database_options = 4;
}
}

message SetDatabaseOptions {
repeated Option set_database_options = 1;
}

message UnsetDatabaseOptions {
repeated string keys = 1;
}
8 changes: 7 additions & 1 deletion proto/greptime/v1/meta/ddl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ message DropTableTask{
message DropTableTasks { repeated DropTableTask tasks = 1; }

message AlterTableTask{
AlterExpr alter_table = 1;
AlterTableExpr alter_table = 1;
}

message AlterTableTasks { repeated AlterTableTask tasks = 1; }
Expand Down Expand Up @@ -79,6 +79,11 @@ message DropViewTask {
DropViewExpr drop_view = 1;
}

// Alter database tasks
message AlterDatabaseTask {
AlterDatabaseExpr task = 1;
}

message DdlTaskRequest {
RequestHeader header = 1;
QueryContext query_context = 64;
Expand All @@ -97,6 +102,7 @@ message DdlTaskRequest {
DropFlowTask drop_flow_task = 12;
CreateViewTask create_view_task = 13;
DropViewTask drop_view_task = 14;
AlterDatabaseTask alter_database_task = 15;
}
}

Expand Down