-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
support cypher parameter #2798
support cypher parameter #2798
Conversation
508a41a
to
d656073
Compare
78b4919
to
fab02c1
Compare
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.
Does this PR not take into account the implementation of parameter binding after the execution plan has been optimized?
c8dbfc8
to
d8cc949
Compare
Codecov Report
@@ Coverage Diff @@
## master #2798 +/- ##
==========================================
- Coverage 84.42% 84.34% -0.09%
==========================================
Files 1284 1286 +2
Lines 113589 113765 +176
==========================================
+ Hits 95899 95951 +52
- Misses 17690 17814 +124
Continue to review full report at Codecov.
|
b94aac6
to
65c7e42
Compare
Parameter push-down is currently not supported. |
When executing query: | ||
""" | ||
$p1=GO FROM "Tim Duncan" OVER like WHERE like.likeness>$p1 yield like._dst as dst; | ||
GO FROM $p1.dst OVER like YIELD DISTINCT $$.player.name AS name |
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.
$p1=GO FROM "Tim Duncan" OVER like WHERE like.likeness>$p1 yield like._dst as dst;
GO FROM $p1.dst OVER like Where like.age > $p1 YIELD DISTINCT $$.player.name AS name.
What is the behavior of this test case?
We need more test cases.
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.
$p1
started as a parameter and was rewritten as a variable, just consistent with what we talked about earlier.
Such as what test cases?
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.
Where did you do the rewriting?
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.
Expression rewriting?
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.
The implementation layer is the same as VariableExpression
, it is based on valueMap_
, so there is no need to do rewriting. valueMap_
is automatically written to at runtime.
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.
$p1=GO FROM "Tim Duncan" OVER like WHERE like.likeness>$p1 yield like._dst as dst; GO FROM $p1.dst OVER like Where like.age > $p1 YIELD DISTINCT $$.player.name AS name.
What is the behavior of this test case? We need more test cases.
Variables and parameters with the same name are not supported for the time being, just consistent with our offline discussion.
// The ParameterExpression use for parameterized statement | ||
namespace nebula { | ||
|
||
class ParameterExpression : public Expression { |
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.
I doubt if we need this one.
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.
Is needed.
Such as lookupValidators or some visitor or scenes that require expression rewriting.
Some Example :
- rewrite ParameterExpression to ConstantExpression
- EvaluableExprVisitor determines whether expressions are evaluable by their specific types. Code likes that:
void visit(VariableExpression *) override { isEvaluable_ = false; }
- If
ParameterExpression
andVariableExpression
are unified, then we must use if-else whenever we need to distinguish them, I don't think this is a good code design pattern.
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 now
0fa92dd
to
9d5c8c6
Compare
@@ -224,7 +224,7 @@ Feature: Go Yield Vertex And Edge Sentence | |||
""" | |||
GO FROM $var OVER like YIELD edge as e | |||
""" | |||
Then a SyntaxError should be raised at runtime: syntax error near `OVER' | |||
Then a SyntaxError should be raised at runtime: can not go from a nonexist parameter near `FROM' |
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.
What happens to this test case? Why do you need modify it?
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.
Go from parameter.
@@ -2003,6 +2021,27 @@ fetch_vertices_sentence | |||
| KW_FETCH KW_PROP KW_ON STAR vid_ref_expression yield_clause { | |||
$$ = new FetchVerticesSentence($5, $6); | |||
} | |||
| KW_FETCH KW_PROP KW_ON name_label_list VARIABLE yield_clause { |
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.
extend vid_ref_expression
to check whether VARIABLE
is parameter
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.
vid_ref_ex}r_wrapper:
| vid_ref_expression {
if () {
throw exception("illegal variable")
}
return $$
|
f3b717d
to
86116aa
Compare
fix aysn block revert nebula-python url disable homonymic parameter variable support sdk interface of map/list support go from parameter support list and map fix tck support fetch small fix for point initialization fix tck add tck support subgraph support find path add tck
Related pr: