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

Fix a crash bug. Deduce props in yield. #5121

Merged
merged 1 commit into from
Dec 27, 2022
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
3 changes: 3 additions & 0 deletions src/graph/validator/GroupByValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Status GroupByValidator::validateYield(const YieldClause* yieldClause) {
aggOutputColNames_.emplace_back(agg->toString());
groupItems_.emplace_back(agg->clone());
needGenProject_ = true;
ExpressionProps yieldProps;
NG_RETURN_IF_ERROR(deduceProps(agg, yieldProps));
exprProps_.unionProps(std::move(yieldProps));
}
if (!aggs.empty()) {
auto* colRewrited = ExpressionUtils::rewriteAgg2VarProp(colExpr->clone());
Expand Down
10 changes: 10 additions & 0 deletions tests/tck/features/yield/parameter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,13 @@ Feature: Parameter
"""
Then a SyntaxError should be raised at runtime: Direct output of variable is prohibited near `$var'
Then clear the used parameters

Scenario: expression with parameters
xtcyclist marked this conversation as resolved.
Show resolved Hide resolved
When executing query:
"""
$var=go from "Tim Duncan" over like yield like._dst as id, like.likeness as likeness;
yield avg($var.likeness)+1 as v;
"""
Then the result should be, in any order:
| v |
| 96.0 |