This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 0e67d8b71b9a4f9699be1ff0d2a547a6b3b134e3 Author: LiBinfeng <[email protected]> AuthorDate: Wed Sep 20 21:16:19 2023 +0800 Revert "[feature](function) add json->operator convert to json_extract (#19899)" (#24679) Revert "[feature](function) add json->operator convert to json_extract (#19899)" because it conflict with lambda syntax This reverts commit f54a068d82e88e8535f3ed55a4224886b752e46b. --- fe/fe-core/src/main/cup/sql_parser.cup | 8 -------- .../json_functions/test_json_function.out | 21 --------------------- .../json_functions/test_json_function.groovy | 8 -------- 3 files changed, 37 deletions(-) diff --git a/fe/fe-core/src/main/cup/sql_parser.cup b/fe/fe-core/src/main/cup/sql_parser.cup index 6f69b0b51b..29873ad1cf 100644 --- a/fe/fe-core/src/main/cup/sql_parser.cup +++ b/fe/fe-core/src/main/cup/sql_parser.cup @@ -972,7 +972,6 @@ precedence left KW_OVER; precedence left KW_COLLATE; precedence left KW_PARTITION; precedence left KW_PARTITIONS; -precedence left ARROW; precedence right KW_TEMPORARY; precedence right LBRACKET; precedence right LBRACE; @@ -6568,13 +6567,6 @@ non_pred_expr ::= {: RESULT = new FunctionCallExpr("concat", exprs); :} - | expr:e ARROW expr:index - {: - ArrayList<Expr> exprs = new ArrayList<>(); - exprs.add(e); - exprs.add(index); - RESULT = new FunctionCallExpr("json_extract", new FunctionParams(exprs)); - :} | cast_expr:c {: RESULT = c; :} | case_expr:c diff --git a/regression-test/data/query_p0/sql_functions/json_functions/test_json_function.out b/regression-test/data/query_p0/sql_functions/json_functions/test_json_function.out index 764c02da6f..2aa6c3e7d3 100644 --- a/regression-test/data/query_p0/sql_functions/json_functions/test_json_function.out +++ b/regression-test/data/query_p0/sql_functions/json_functions/test_json_function.out @@ -125,27 +125,6 @@ DORIS -- !sql -- [6.6,[1,2,3],2] --- !sql -- -"doris" - --- !sql -- -\N - --- !sql -- -{"k21":6.6,"k22":[1,2,3]} - --- !sql -- -3 - --- !sql -- -[1,2,3] - --- !sql -- -doris - --- !sql -- -123 - -- !sql -- true diff --git a/regression-test/suites/query_p0/sql_functions/json_functions/test_json_function.groovy b/regression-test/suites/query_p0/sql_functions/json_functions/test_json_function.groovy index 2aa4056198..ef9eb7637c 100644 --- a/regression-test/suites/query_p0/sql_functions/json_functions/test_json_function.groovy +++ b/regression-test/suites/query_p0/sql_functions/json_functions/test_json_function.groovy @@ -67,14 +67,6 @@ suite("test_json_function") { qt_sql "SELECT json_extract('{\"k1\": \"v1\", \"k2\": { \"k21\": 6.6, \"k22\": [1, 2, 3] } }', '\$.k1', '\$.k2');" qt_sql "SELECT json_extract('{\"k1\": \"v1\", \"k2\": { \"k21\": 6.6, \"k22\": [1, 2, 3] } }', '\$.k2.k21', '\$.k2.k22', '\$.k2.k22[1]');" - qt_sql "SELECT '{\"id\": 123, \"name\": \"doris\"}'->'\$.name';" - qt_sql "SELECT null->'\$.id';" - qt_sql "SELECT '{\"k1\": \"v1\", \"k2\": { \"k21\": 6.6, \"k22\": [1, 2, 3] } }'->'\$.k2';" - qt_sql "SELECT '{\"k1\": \"v1\", \"k2\": { \"k21\": 6.6, \"k22\": [1, 2, 3] } }'->'\$.k2.k22[2]';" - qt_sql "SELECT '{\"k1\": \"v1\", \"k2\": { \"k21\": 6.6, \"k22\": [1, 2, 3] } }'->'\$.k2'->'\$.k22'" - qt_sql "SELECT json_unquote('{\"id\": 123, \"name\": \"doris\"}'->'\$.name');" - qt_sql "SELECT json_extract('{\"id\": 123, \"name\": \"doris\"}', '\$.id', '\$.name')->'\$.[0]';" - qt_sql "SELECT JSON_CONTAINS('{\"a\": 1, \"b\": 2, \"c\": {\"d\": 4}}','1','\$.a');" qt_sql "SELECT JSON_CONTAINS('{\"a\": 1, \"b\": 2, \"c\": {\"d\": 4}}','1','\$.b');" qt_sql "SELECT JSON_CONTAINS('{\"a\": 1, \"b\": 2, \"c\": {\"d\": 4}}','{\"d\": 4}','\$.a');" --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
