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

chore: Refactor UnaryExpr and MathExpr in protobuf #1056

Merged
merged 1 commit into from
Nov 6, 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
68 changes: 12 additions & 56 deletions native/proto/src/proto/expr.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ message Expr {
oneof expr_struct {
Literal literal = 2;
BoundReference bound = 3;
Add add = 4;
Subtract subtract = 5;
Multiply multiply = 6;
Divide divide = 7;
MathExpr add = 4;
MathExpr subtract = 5;
MathExpr multiply = 6;
MathExpr divide = 7;
Cast cast = 8;
BinaryExpr eq = 9;
BinaryExpr neq = 10;
BinaryExpr gt = 11;
BinaryExpr gt_eq = 12;
BinaryExpr lt = 13;
BinaryExpr lt_eq = 14;
IsNull is_null = 15;
IsNotNull is_not_null = 16;
UnaryExpr is_null = 15;
UnaryExpr is_not_null = 16;
BinaryExpr and = 17;
BinaryExpr or = 18;
SortOrder sort_order = 19;
Substring substring = 20;
StringSpace string_space = 21;
UnaryExpr string_space = 21;
Hour hour = 22;
Minute minute = 23;
Second second = 24;
Expand All @@ -61,18 +61,18 @@ message Expr {
BinaryExpr bitwiseAnd = 34;
BinaryExpr bitwiseOr = 35;
BinaryExpr bitwiseXor = 36;
Remainder remainder = 37;
MathExpr remainder = 37;
CaseWhen caseWhen = 38;
In in = 39;
Not not = 40;
UnaryExpr not = 40;
UnaryMinus unary_minus = 41;
BinaryExpr bitwiseShiftRight = 42;
BinaryExpr bitwiseShiftLeft = 43;
IfExpr if = 44;
NormalizeNaNAndZero normalize_nan_and_zero = 45;
TruncDate truncDate = 46;
TruncTimestamp truncTimestamp = 47;
BitwiseNot bitwiseNot = 48;
UnaryExpr bitwiseNot = 48;
Abs abs = 49;
Subquery subquery = 50;
UnboundReference unbound = 51;
Expand Down Expand Up @@ -220,35 +220,7 @@ message Literal {
bool is_null = 12;
}

message Add {
Expr left = 1;
Expr right = 2;
bool fail_on_error = 3;
DataType return_type = 4;
}

message Subtract {
Expr left = 1;
Expr right = 2;
bool fail_on_error = 3;
DataType return_type = 4;
}

message Multiply {
Expr left = 1;
Expr right = 2;
bool fail_on_error = 3;
DataType return_type = 4;
}

message Divide {
Expr left = 1;
Expr right = 2;
bool fail_on_error = 3;
DataType return_type = 4;
}

message Remainder {
message MathExpr {
Expr left = 1;
Expr right = 2;
bool fail_on_error = 3;
Expand All @@ -274,11 +246,7 @@ message BinaryExpr {
Expr right = 2;
}

message IsNull {
Expr child = 1;
}

message IsNotNull {
message UnaryExpr {
Expr child = 1;
}

Expand All @@ -305,10 +273,6 @@ message Substring {
int32 len = 3;
}

message StringSpace {
Expr child = 1;
}

message ToJson {
Expr child = 1;
string timezone = 2;
Expand Down Expand Up @@ -368,10 +332,6 @@ message NormalizeNaNAndZero {
DataType datatype = 2;
}

message Not {
Expr child = 1;
}

message UnaryMinus {
Expr child = 1;
bool fail_on_error = 2;
Expand All @@ -394,10 +354,6 @@ message TruncTimestamp {
string timezone = 3;
}

message BitwiseNot {
Expr child = 1;
}

message Abs {
Expr child = 1;
EvalMode eval_mode = 2;
Expand Down
Loading
Loading