dawidwys commented on code in PR #3771:
URL: https://github.com/apache/calcite/pull/3771#discussion_r1594080650


##########
core/src/test/java/org/apache/calcite/test/JdbcTest.java:
##########
@@ -8056,6 +8056,71 @@ private void checkGetTimestamp(Connection con) throws 
SQLException {
         .returns("C1=OBJECT; C2=ARRAY; C3=INTEGER; C4=BOOLEAN\n");
   }
 
+  @Test void testJsonQuery() {
+    CalciteAssert.that()
+        .query("SELECT JSON_QUERY(v, '$.a') AS c1\n"
+            + ",JSON_QUERY(v, '$.a' RETURNING INTEGER ARRAY) AS c2\n"
+            + ",JSON_QUERY(v, '$.b' RETURNING INTEGER ARRAY EMPTY ARRAY ON 
ERROR) AS c3\n"
+            + ",JSON_QUERY(v, '$.b' RETURNING VARCHAR ARRAY WITH ARRAY 
WRAPPER) AS c4\n"
+            + "FROM (VALUES ('{\"a\": [1, 2],\"b\": \"[1, 2]\"}')) AS t(v)\n"
+            + "limit 10")

Review Comment:
   I tried removing the `LIMIT`. I don't understand why, but the presence 
causes a different type of exception to be thrown. With `LIMIT` we get 
`SqlException`, without `CalciteException`. The message and origin stays the 
same.
   
   To be consistent with other tests, I left the `LIMIT`. Let me know what do 
you think.



-- 
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]

Reply via email to