-
Notifications
You must be signed in to change notification settings - Fork 448
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
[GIE Compiler] Support Case When Expression in Logical and Physical Plan #2918
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2918 +/- ##
=======================================
Coverage 42.37% 42.37%
=======================================
Files 99 99
Lines 10649 10649
=======================================
Hits 4512 4512
Misses 6137 6137 Continue to review full report in Codecov by Sentry.
|
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class GraphCaseOperator extends SqlOperator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is CaseOperator
instead of GraphCaseOperator
, as it is not a Graph
operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
public class CaseTest { | ||
// case when a.name = 'marko' then 1 else 3 end | ||
@Test | ||
public void case_1_test() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add test of more than two branches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more cases are added in interactive_engine/compiler/src/test/java/com/alibaba/graphscope/cypher/antlr4/WithTest.java
@@ -124,6 +124,15 @@ message DynamicParam { | |||
common.IrDataType data_type = 3; | |||
} | |||
|
|||
message Case { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message Case {
// Pair of when <expr> then <expr>
message WhenThen {
Expression when = 1;
Expression then = 2;
}
// A case operator always follows with a sequence of when_then pairs, e.g.
// CASE WHEN a.name == 'Marko' THEN 1
// WHEN a.name == 'John' THEN 2
repeated WhenThen when_thens = 1;
// The trailed else expression: ELSE 3
Expression else_result = 2;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What do these changes do?
as titled.
Related issue number
#2686