feat: add QueryContext to DdlTaskRequest and FlowRequestHeader (#166)

This commit is contained in:
Weny Xu
2024-05-09 15:27:41 +09:00
committed by GitHub
parent 5c28f1d7ca
commit e152fcbf17
18 changed files with 5846 additions and 3186 deletions
+7
View File
@@ -20,6 +20,13 @@ option java_package = "io.greptime.v1";
option java_outer_classname = "Common";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
message QueryContext {
string current_catalog = 1;
string current_schema = 2;
string timezone = 4;
map<string, string> extensions = 5;
}
message RequestHeader {
// The `catalog` that is selected to be used in this request.
string catalog = 1;
+9
View File
@@ -33,6 +33,14 @@ service Flow {
rpc HandleMirrorRequest(InsertRequests) returns (FlowResponse);
}
message FlowRequestHeader {
// Encoded trace_id & span_id, follow the w3c Trace Context
// https://www.w3.org/TR/trace-context/#header-name
map<string, string> tracing_context = 1;
// The contextual information of the query
QueryContext query_context = 2;
}
message InsertRequests { repeated InsertRequest requests = 1; }
message InsertRequest {
@@ -41,6 +49,7 @@ message InsertRequest {
}
message FlowRequest {
FlowRequestHeader header = 64;
oneof body {
CreateRequest create = 1;
DropRequest drop = 2;
+2
View File
@@ -21,6 +21,7 @@ option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"
import "greptime/v1/meta/common.proto";
import "greptime/v1/meta/route.proto";
import "greptime/v1/ddl.proto";
import "greptime/v1/common.proto";
enum DdlTaskType {
Create = 0;
@@ -69,6 +70,7 @@ message DropFlowTask {
message DdlTaskRequest {
RequestHeader header = 1;
QueryContext query_context = 64;
oneof task {
CreateTableTask create_table_task = 2;
-7
View File
@@ -26,13 +26,6 @@ import "greptime/v1/ddl.proto";
service Region { rpc Handle(RegionRequest) returns (RegionResponse); }
message QueryContext {
string current_catalog = 1;
string current_schema = 2;
string timezone = 4;
map<string, string> extensions = 5;
}
message RegionRequestHeader {
// Encoded trace_id & span_id, follow the w3c Trace Context
// https://www.w3.org/TR/trace-context/#header-name