andygrove commented on code in PR #1470: URL: https://github.com/apache/datafusion-comet/pull/1470#discussion_r1981942739
########## spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala: ########## @@ -1586,6 +1586,18 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde with CometExprShim case StringTrimBoth(srcStr, trimStr, _) => trim(expr, srcStr, trimStr, inputs, binding, "btrim") + case StringLPad(srcStr, size, chars) => + val arg0 = exprToProtoInternal(srcStr, inputs, binding) + val arg1 = exprToProtoInternal(Cast(size, LongType), inputs, binding) + val arg2 = exprToProtoInternal(chars, inputs, binding) + scalarExprToProto("lpad", arg0, arg1, arg2) + + case StringRPad(srcStr, size, chars) => + val arg0 = exprToProtoInternal(srcStr, inputs, binding) + val arg1 = exprToProtoInternal(Cast(size, LongType), inputs, binding) + val arg2 = exprToProtoInternal(chars, inputs, binding) + scalarExprToProto("rpad", arg0, arg1, arg2) Review Comment: Yes, DataFusion's `rpad` implementation works on graphemes. I am not 100% sure but I think Postgres's version works on unicode code points. -- 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