Skip to content

Commit

Permalink
feat: alter database ttl (#203)
Browse files Browse the repository at this point in the history
* feat: alter database ttl

* chore: add ddl task

* chore: single task

* chore: remove options

* feat: add unset database options

---------

Co-authored-by: CookiePieWw <[email protected]>
  • Loading branch information
WenyXu and CookiePieWw authored Nov 21, 2024
1 parent 0b90ddc commit a875e97
Show file tree
Hide file tree
Showing 10 changed files with 10,131 additions and 3,283 deletions.
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

0 comments on commit a875e97

Please sign in to comment.