This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 2e85e0163d Revert "[feature](function) add json->operator convert to
json_extract (#19899)" (#24679)
2e85e0163d is described below
commit 2e85e0163dd26d43f4a8e86967afba78527e7c62
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.
---
.../sql-functions/json-functions/json-extract.md | 17 -----------------
.../sql-functions/json-functions/json-extract.md | 17 -----------------
fe/fe-core/src/main/cup/sql_parser.cup | 8 --------
.../json_functions/test_json_function.out | 21 ---------------------
.../json_functions/test_json_function.groovy | 8 --------
5 files changed, 71 deletions(-)
diff --git
a/docs/en/docs/sql-manual/sql-functions/json-functions/json-extract.md
b/docs/en/docs/sql-manual/sql-functions/json-functions/json-extract.md
index 20ffcee9a8..2e9aff54b0 100644
--- a/docs/en/docs/sql-manual/sql-functions/json-functions/json-extract.md
+++ b/docs/en/docs/sql-manual/sql-functions/json-functions/json-extract.md
@@ -42,7 +42,6 @@ BIGINT json_extract_bigint(JSON j, VARCHAR json_path)
LARGEINT json_extract_largeint(JSON j, VARCHAR json_path)
DOUBLE json_extract_double(JSON j, VARCHAR json_path)
STRING json_extract_string(JSON j, VARCHAR json_path)
-VARCHAR json_str->json_path
```
json_extract functions extract field specified by json_path from JSON. A
series of functions are provided for different datatype.
@@ -128,22 +127,6 @@ mysql> SELECT json_extract('{"id": 123, "name": "doris"}',
'$.aaa', '$.name');
| [null,"doris"] |
+-----------------------------------------------------------------+
1 row in set (0.01 sec)
-
-mysql> SELECT '{"id": 123, "name": "doris"}'->'$.name';
-+--------------------------------------------------------+
-| json_extract('{"id": 123, "name": "doris"}', '$.name') |
-+--------------------------------------------------------+
-| "doris" |
-+--------------------------------------------------------+
-1 row in set (0.01 sec)
-
-mysql> SELECT '{"k1": "v1", "k2": { "k21": 6.6, "k22": [1, 2, 3] }
}'->'$.k2.k22[2]';
-+--------------------------------------------------------------------------------------+
-| json_extract('{"k1": "v1", "k2": { "k21": 6.6, "k22": [1, 2, 3] } }',
'$.k2.k22[2]') |
-+--------------------------------------------------------------------------------------+
-| 3
|
-+--------------------------------------------------------------------------------------+
-1 row in set (0.00 sec)
```
diff --git
a/docs/zh-CN/docs/sql-manual/sql-functions/json-functions/json-extract.md
b/docs/zh-CN/docs/sql-manual/sql-functions/json-functions/json-extract.md
index 560622cd83..d5b9de67a3 100644
--- a/docs/zh-CN/docs/sql-manual/sql-functions/json-functions/json-extract.md
+++ b/docs/zh-CN/docs/sql-manual/sql-functions/json-functions/json-extract.md
@@ -41,7 +41,6 @@ BIGINT json_extract_bigint(JSON j, VARCHAR json_path)
LARGEINT json_extract_largeint(JSON j, VARCHAR json_path)
DOUBLE json_extract_double(JSON j, VARCHAR json_path)
STRING json_extract_string(JSON j, VARCHAR json_path)
-VARCHAR json_str->json_path
```
@@ -104,22 +103,6 @@ mysql> SELECT json_extract('{"id": 123, "name": "doris"}',
'$.aaa', '$.name');
| [null,"doris"] |
+-----------------------------------------------------------------+
1 row in set (0.01 sec)
-
-mysql> SELECT '{"id": 123, "name": "doris"}'->'$.name';
-+--------------------------------------------------------+
-| json_extract('{"id": 123, "name": "doris"}', '$.name') |
-+--------------------------------------------------------+
-| "doris" |
-+--------------------------------------------------------+
-1 row in set (0.01 sec)
-
-mysql> SELECT '{"k1": "v1", "k2": { "k21": 6.6, "k22": [1, 2, 3] }
}'->'$.k2.k22[2]';
-+--------------------------------------------------------------------------------------+
-| json_extract('{"k1": "v1", "k2": { "k21": 6.6, "k22": [1, 2, 3] } }',
'$.k2.k22[2]') |
-+--------------------------------------------------------------------------------------+
-| 3
|
-+--------------------------------------------------------------------------------------+
-1 row in set (0.00 sec)
```
### keywords
diff --git a/fe/fe-core/src/main/cup/sql_parser.cup
b/fe/fe-core/src/main/cup/sql_parser.cup
index baec3cd18d..437b710e7f 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -986,7 +986,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;
@@ -6723,13 +6722,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]