924060929 commented on code in PR #12132:
URL: https://github.com/apache/doris/pull/12132#discussion_r958456643


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/util/Utils.java:
##########
@@ -119,4 +120,30 @@ public static List<SlotReference> 
getOutputSlotReference(Plan plan) {
         return plan.getOutput().stream().map(SlotReference.class::cast)
                 .collect(Collectors.toList());
     }
+
+    /**
+     * Get sql string for plan.
+     *
+     * @param planName name of plan, like LogicalJoin.
+     * @param variables variable needed to add into sqlString.
+     * @return the string of PlanNode.
+     */
+    public static String toSqlString(String planName, String... variables) {

Review Comment:
   `Utils.toSqlString('someField', someField.toString()` maybe throw NPE 
because someField is null.
   So I suggest judge variables whether is null at here and convert to 'null' 
string.
   Let's relax to invoke `Util.toSqlString('someField', someField)` and don't 
care about whether the someField is null.
   
   ```suggestion
       public static String toSqlString(String planName, Object... variables) {
   ```



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