XuQianJin-Stars commented on a change in pull request #1150: [CALCITE-2985] Add 
the JSON_STORAGE_SIZE function
URL: https://github.com/apache/calcite/pull/1150#discussion_r275193272
 
 

 ##########
 File path: 
core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java
 ##########
 @@ -4491,6 +4491,21 @@ private void checkNullOperand(SqlTester tester, String 
op) {
         "null", "VARCHAR(2000) NOT NULL");
   }
 
+  @Test public void testJsonStorageSize() {
+    tester.checkString("json_storage_size('[100, \"sakila\", [1, 3, 5], 
425.05]')",
+            "29", "INTEGER");
+    tester.checkString("json_storage_size('{\"a\": 1000, \"b\": \"a\", \"c\": 
\"[1, 3, 5, 7]\"}')",
+            "37", "INTEGER");
+    tester.checkString("json_storage_size('{\"a\": 1000, \"b\": \"wxyz\", 
\"c\": \"[1, 3]\"}')",
+            "34", "INTEGER");
+    tester.checkString("json_storage_size('[100, \"json\", [[10, 20, 30], 3, 
5], 425.05]')",
+            "36", "INTEGER");
+    tester.checkString("json_storage_size('null')",
+            null, "INTEGER");
 
 Review comment:
   well,Thanks for reminding me. I adjusted this mistake.

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