You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/03/03 07:53:04 UTC

[GitHub] ritesh-kapoor commented on a change in pull request #1075: [CALCITE-2881] Add the JSON_PRETTY function

ritesh-kapoor commented on a change in pull request #1075: [CALCITE-2881] Add the JSON_PRETTY function
URL: https://github.com/apache/calcite/pull/1075#discussion_r261855373
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
 ##########
 @@ -2676,6 +2675,15 @@ public static void jsonArrayAggAdd(List list, Object element,
     }
   }
 
+  public static String jsonPretty(Object input) {
+    try {
+      return JSON_PATH_JSON_PROVIDER.getObjectMapper().writerWithDefaultPrettyPrinter()
+          .writeValueAsString(input);
+    } catch (Exception e) {
+      return null;
 
 Review comment:
   I have addressed the required changes. Thanks.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services