Skip to content

Commit f35f424

Browse files
committed
address comments
1 parent 112be65 commit f35f424

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

core/src/test/java/org/opensearch/sql/expression/json/JsonFunctionsTest.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,12 @@ void json_extract_throws_SemanticCheckException() {
290290
DSL.literal(new ExprStringValue("{\"invalid\":\"json\", \"string\"}")),
291291
DSL.literal(new ExprStringValue("$.a")))
292292
.valueOf());
293-
assertEquals(
294-
"JSON string '\"{\"invalid\":\"json\", \"string\"}\"' is not valid. Error details:"
295-
+ " net.minidev.json.parser.ParseException: Unexpected character (}) at position 26.",
296-
invalidJsonError.getMessage());
293+
assertTrue(
294+
invalidJsonError
295+
.getMessage()
296+
.startsWith(
297+
"JSON string '\"{\"invalid\":\"json\", \"string\"}\"' is not valid. Error"
298+
+ " details:"));
297299
}
298300

299301
@Test

docs/user/ppl/functions/json.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Argument type: STRING, STRING
7575

7676
Return type: STRING/BOOLEAN/DOUBLE/INTEGER/NULL/STRUCT/ARRAY
7777

78-
- Returns a JSON array if path points to multiple results (e.g. $.a[*]) or if the path points to an array.
79-
- Return null if path is not valid is MISSING or NULL.
78+
- Returns a JSON array if `path` points to multiple results (e.g. $.a[*]) or if the `path` points to an array.
79+
- Return null if `path` is not valid, or if JSON `doc` is MISSING or NULL.
8080
- Throws SemanticCheckException if `doc` or `path` is malformed.
8181
- Throws ExpressionEvaluationException if `path` is missing.
8282

0 commit comments

Comments
 (0)