izchen commented on a change in pull request #3460:
URL: https://github.com/apache/iceberg/pull/3460#discussion_r750612878



##########
File path: 
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java
##########
@@ -636,17 +635,17 @@ public String or(String leftResult, String rightResult) {
         case NOT_NAN:
           return "not_nan(" + pred.ref().name() + ")";
         case LT:
-          return pred.ref().name() + " < " + sqlString(pred.literal());
+          return pred.ref().name() + " < " + pred.literal();
         case LT_EQ:
-          return pred.ref().name() + " <= " + sqlString(pred.literal());
+          return pred.ref().name() + " <= " + pred.literal();
         case GT:
-          return pred.ref().name() + " > " + sqlString(pred.literal());
+          return pred.ref().name() + " > " + pred.literal();
         case GT_EQ:
-          return pred.ref().name() + " >= " + sqlString(pred.literal());
+          return pred.ref().name() + " >= " + pred.literal();
         case EQ:
-          return pred.ref().name() + " = " + sqlString(pred.literal());
+          return pred.ref().name() + " = " + pred.literal();
         case NOT_EQ:
-          return pred.ref().name() + " != " + sqlString(pred.literal());
+          return pred.ref().name() + " != " + pred.literal();

Review comment:
       `sqlString` is implemented and used in the DescribeExpressionVisitor 
class.
   
   I think this class is just for generating description information, and the 
description will be displayed in the log and Spark UI for debugging. So in my 
opinion, it is an acceptable way to use `Literal.toString` directly, which 
ensures that the description is the same as the style of other logs.
   
   In fact, except for the difference between StringLiteral's single and double 
quotes, the current `sqlString` and `Literal.toString` are the same.
   
   But if you think that keeping sqlString is a better way, I can also modify 
the code.
   In addition, there are some differences between the description form of 
spark here, for example, the StringLiteral of spark does not have quotation 
marks. If you think that this should be the same as the behavior of spark, I 
can also modify the code.
   




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