Skip to content

Commit

Permalink
feat: add QueryContext to RegionRequestHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelvinyu1117 committed Apr 27, 2024
1 parent 2c14c6e commit 2426058
Show file tree
Hide file tree
Showing 9 changed files with 11,009 additions and 4,253 deletions.
647 changes: 610 additions & 37 deletions c++/greptime/v1/common.pb.cc

Large diffs are not rendered by default.

629 changes: 625 additions & 4 deletions c++/greptime/v1/common.pb.h

Large diffs are not rendered by default.

912 changes: 774 additions & 138 deletions c++/greptime/v1/region/server.pb.cc

Large diffs are not rendered by default.

796 changes: 772 additions & 24 deletions c++/greptime/v1/region/server.pb.h

Large diffs are not rendered by default.

603 changes: 489 additions & 114 deletions go/greptime/v1/common.pb.go

Large diffs are not rendered by default.

9,531 changes: 5,699 additions & 3,832 deletions java/src/main/java/io/greptime/v1/Common.java

Large diffs are not rendered by default.

2,098 changes: 1,994 additions & 104 deletions java/src/main/java/io/greptime/v1/region/Server.java

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions proto/greptime/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,40 @@ enum ColumnDataType {
DECIMAL128 = 30;
}

enum SqlDialect {
MYSQL = 0;
POSTGRES = 1;
GREPTIMEDB = 2;
}

enum PostgresByteaOutputValue {
HEX = 0;
ESCAPE = 1;
}

enum PostgresDateTimeStyle {
ISO = 0;
SQL = 1;
Postgres = 2;
German = 3;
}

enum PostgresDateOrder {
MDY = 0;
DMY = 1;
YMD = 2;
}

message PostgresDateStyleFormat {
PostgresDateTimeStyle date_style = 1;
PostgresDateOrder date_order = 2;
}

message ConfigurationVariables {
PostgresByteaOutputValue bytea_output = 1;
PostgresDateStyleFormat datestyle_format = 2;
}

message IntervalMonthDayNano {
int32 months = 1;
int32 days = 2;
Expand Down
12 changes: 12 additions & 0 deletions proto/greptime/v1/region/server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ import "greptime/v1/ddl.proto";

service Region { rpc Handle(RegionRequest) returns (RegionResponse); }

message QueryContext {
string current_catalog = 1;
string current_schema = 2;
string current_user = 3;
string timezone = 4;
map<string, string> extension = 5;
SqlDialect sql_dialect = 6;
ConfigurationVariables configuration_parameter = 7;
}

message RegionRequestHeader {
// Encoded trace_id & span_id, follow the w3c Trace Context
// https://www.w3.org/TR/trace-context/#header-name
Expand All @@ -34,6 +44,8 @@ message RegionRequestHeader {
string dbname = 3;
// The `timezone` for the request
string timezone = 4;
// The contextual information of the query
QueryContext query_context = 6;
}

message RegionRequest {
Expand Down

0 comments on commit 2426058

Please sign in to comment.