XuQianJin-Stars commented on a change in pull request #1277: [CALCITE-3139] 
Implement JSON_EXTRACT function
URL: https://github.com/apache/calcite/pull/1277#discussion_r297513765
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
 ##########
 @@ -11070,11 +11070,18 @@ private void checkCustomColumnResolving(String 
table) {
     checkExpType("json_keys('{\"foo\":\"bar\"}', 'strict $')", 
"VARCHAR(2000)");
   }
 
+  @Test public void testJsonExtract() {
+    checkExp("json_extract('{\"foo\":\"bar\"}', '$')");
+    checkExpType("json_extract('{\"foo\":\"bar\"}', '$')", "VARCHAR(2000)");
+    checkFails("select ^json_extract('{\"foo\":\"bar\"}')^",
+        "(?s).*Invalid number of arguments.*");
+  }
+
   @Test public void testJsonRemove() {
     checkExp("json_remove('{\"foo\":\"bar\"}', '$')");
     checkExpType("json_remove('{\"foo\":\"bar\"}', '$')", "VARCHAR(2000)");
     checkFails("select ^json_remove('{\"foo\":\"bar\"}')^",
-            "(?s).*Invalid number of arguments.*");
+        "(?s).*Invalid number of arguments.*");
   }
 
 Review comment:
   yes,This is the expected change.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to