diff --git a/src/parser/parser.yy b/src/parser/parser.yy index d68ff21dd0a385f4ab156c4a3da4a299f20c6cf0..2a9643d84678f9fee21d1f4e2257c3b7de4656e0 100644 --- a/src/parser/parser.yy +++ b/src/parser/parser.yy @@ -893,6 +893,9 @@ function_call_expression | KW_TAGS L_PAREN opt_argument_list R_PAREN { $$ = new FunctionCallExpression(new std::string("tags"), $3); } + | KW_SIGN L_PAREN opt_argument_list R_PAREN { + $$ = new FunctionCallExpression(new std::string("sign"), $3); + } ; aggregate_expression diff --git a/tests/tck/features/expression/FunctionCall.feature b/tests/tck/features/expression/FunctionCall.feature new file mode 100644 index 0000000000000000000000000000000000000000..8b60169175607dfdcdbd82402eb95186644202a6 --- /dev/null +++ b/tests/tck/features/expression/FunctionCall.feature @@ -0,0 +1,18 @@ +# Copyright (c) 2021 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. +Feature: Function Call Expression + + Background: + Given a graph with space named "nba" + + Scenario: sign + When executing query: + """ + YIELD sign(38) AS a, sign(-2) AS b, sign(0.421) AS c, + sign(-1.0) AS d, sign(0) AS e, sign(abs(-3)) AS f + """ + Then the result should be, in any order: + | a | b | c | d | e | f | + | 1 | -1 | 1 | -1 | 0 | 1 |