diff --git a/src/graph/validator/GroupByValidator.cpp b/src/graph/validator/GroupByValidator.cpp index ec61cff8d0f..9d947b92bfd 100644 --- a/src/graph/validator/GroupByValidator.cpp +++ b/src/graph/validator/GroupByValidator.cpp @@ -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()); diff --git a/tests/tck/features/yield/parameter.feature b/tests/tck/features/yield/parameter.feature index 473ee09fe35..717c11cd9cf 100644 --- a/tests/tck/features/yield/parameter.feature +++ b/tests/tck/features/yield/parameter.feature @@ -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 + 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 |