snuyanzin commented on code in PR #28688:
URL: https://github.com/apache/flink/pull/28688#discussion_r3577678582
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/JsonFunctionsITCase.java:
##########
@@ -97,6 +98,147 @@ Stream<TestSetSpec> getTestSetSpecs() {
return testCases.stream();
}
+ private static TestSetSpec jsonLengthSpec() {
+ final String jsonValue = getJsonFromResource("/json/json-exists.json");
+
+ return TestSetSpec.forFunction(BuiltInFunctionDefinitions.JSON_LENGTH)
+ .onFieldsWithData(
+ jsonValue, // f0: existing resource JSON
+ "{\"a\":1,\"b\":2}", // f1: object
+ "[1,2,3]", // f2: array
+ "\"abc\"", // f3: scalar string
+ "null", // f4: JSON null
+ "{", // f5: invalid JSON
+ ((String) null), // f6: SQL NULL
+ "$",
+ "{\"a\":[true, false, null]}", // f8
+ "{}", // f9: empty object
+ "[]") // f10: empty array
Review Comment:
not sure we need all these comments, what a value it could give to the
reader who sees that `{}` is an empty object and then a comment telling same?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]