kazuyukitanimura commented on code in PR #1470:
URL: https://github.com/apache/datafusion-comet/pull/1470#discussion_r1981978575


##########
spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala:
##########
@@ -1755,6 +1755,28 @@ object QueryPlanSerde extends Logging with 
ShimQueryPlanSerde with CometExprShim
           None
         }
 
+      // read-side padding in Spark 3.5.2+ is represented by rpad function
+      case StringRPad(srcStr, size, chars) =>
+        chars match {
+          case Literal(str, DataTypes.StringType) if str.toString == " " =>
+            val arg0 = exprToProtoInternal(srcStr, inputs, binding)
+            val arg1 = exprToProtoInternal(size, inputs, binding)
+            if (arg0.isDefined && arg1.isDefined) {
+              val builder = ExprOuterClass.ScalarFunc.newBuilder()
+              builder.setFunc("rpad")
+              builder.addArgs(arg0.get)
+              builder.addArgs(arg1.get)
+              
Some(ExprOuterClass.Expr.newBuilder().setScalarFunc(builder).build())

Review Comment:
   This can be done by using `scalarExprToProto` function 
https://github.com/apache/datafusion-comet/blob/main/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala#L2173
   If you would prefer to work on it separately, that's ok as the old read-side 
padding is doing the same thing. Would you mind filing an issue for it?



-- 
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: github-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to