-
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
Correct the yeild var input bug. #2789
Conversation
Disable user-defined variables? What does "used inner" mean? |
The variable generated by developer when validating. |
@@ -137,7 +137,10 @@ void DeducePropsVisitor::visit(InputPropertyExpression *expr) { | |||
|
|||
void DeducePropsVisitor::visit(VariablePropertyExpression *expr) { | |||
exprProps_->insertVarProp(expr->sym(), expr->prop()); | |||
userDefinedVarNameList_->emplace(expr->sym()); | |||
if (expr->sym()[0] != '_') { |
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 does if (expr->sym()[0] != '_')
mean?
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.
Means variable from query instead of inner generated variable.
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 there a better alternative implementation.
It's very unfriendly to someone reading this code.
Scenario: yield constant after pipe | ||
When executing query: | ||
""" | ||
$var = GO FROM "Tim Duncan" OVER *; YIELD $var[0][0] as var00; | ||
""" | ||
Then the result should be, in any order: | ||
| var00 | | ||
| "Manu Ginobili" | | ||
| "Manu Ginobili" | | ||
| "Manu Ginobili" | | ||
| "Manu Ginobili" | | ||
| "Manu Ginobili" | | ||
| "Manu Ginobili" | | ||
| "Manu Ginobili" | |
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.
Why is $var[0][0]
not one row?
(czp@nebula) [nba]> $var = GO FROM "Tim Duncan" OVER *; YIELD $var[0][0] as var00;
+-----------------+
| var00 |
+-----------------+
| "Manu Ginobili" |
+-----------------+
Got 1 rows (time spent 7942/9138 us)
Mon, 25 Oct 2021 14:11:31 CST
(czp@nebula) [nba]> $var = GO FROM "Tim Duncan" OVER *;
+-----------------+------------+---------------------+
| like._dst | serve._dst | teammate._dst |
+-----------------+------------+---------------------+
| "Manu Ginobili" | | |
+-----------------+------------+---------------------+
| "Tony Parker" | | |
+-----------------+------------+---------------------+
| | "Spurs" | |
+-----------------+------------+---------------------+
| | | "Danny Green" |
+-----------------+------------+---------------------+
| | | "LaMarcus Aldridge" |
+-----------------+------------+---------------------+
| | | "Manu Ginobili" |
+-----------------+------------+---------------------+
| | | "Tony Parker" |
+-----------------+------------+---------------------+
Got 7 rows (time spent 7580/8871 us)
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 result of project keep row count of input variable.
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 understand this, but the inconsistency with the semantics of the statement is confusing to users.
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.
A little strange. We also could add more input variables to Project to get one row result, but this need discussion.
Replace by #3271 |
Close #2495 Close #2646
ps.Maybe I think disable user write variable expression is better, the variable expression just used inner.