Skip to content
Snippets Groups Projects
Unverified Commit 831233e6 authored by jie.wang's avatar jie.wang Committed by GitHub
Browse files

Support sign function in parser (#740)


* support function sign in parser

* add test

Co-authored-by: default avatarYee <2520865+yixinglu@users.noreply.github.com>
parent 7111738e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
# 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 |
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment