You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/05 09:08:34 UTC

[GitHub] [spark] beliefer commented on a diff in pull request #36330: [SPARK-38897][SQL] DS V2 supports push down string functions

beliefer commented on code in PR #36330:
URL: https://github.com/apache/spark/pull/36330#discussion_r865701509


##########
sql/core/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -223,23 +223,23 @@ class V2ExpressionBuilder(
     case trim: StringTrim =>
       val childrenExpressions = trim.children.flatMap(generateExpression(_))
       if (childrenExpressions.length == trim.children.length) {
-        Some(new GeneralScalarExpression("TRIM",
+        Some(new GeneralScalarExpression("TRIM_BOTH",

Review Comment:
   How about pass `""` ?



##########
sql/core/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -223,23 +223,23 @@ class V2ExpressionBuilder(
     case trim: StringTrim =>
       val childrenExpressions = trim.children.flatMap(generateExpression(_))
       if (childrenExpressions.length == trim.children.length) {
-        Some(new GeneralScalarExpression("TRIM",
+        Some(new GeneralScalarExpression("TRIM_BOTH",

Review Comment:
   So, we can simplify `visitTrim`.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org