soumyakanti3578 commented on code in PR #6067:
URL: https://github.com/apache/hive/pull/6067#discussion_r2396369971


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelOptUtil.java:
##########
@@ -1079,15 +1106,110 @@ public static Pair<RelOptTable, List<Integer>> 
getColumnOriginSet(RelNode rel, I
    * to parse the string back.
    */
   public static String toJsonString(final RelNode rel) {
+    return serializeWithPlanWriter(rel, new HiveRelJsonImplWithStats());
+  }
+
+  private static String serializeWithPlanWriter(RelNode rel, HiveRelJsonImpl 
planWriter) {
     if (rel == null) {
       return null;
     }
-
-    final HiveRelJsonImpl planWriter = new HiveRelJsonImpl();
     rel.explain(planWriter);
     return planWriter.asString();
   }
 
+  public static Optional<String> serializeToJSON(RelNode plan) {

Review Comment:
   I think I will change it back to `toJsonString`. Maybe add a boolean 
variable `withStats`.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to