andygrove commented on code in PR #2630:
URL: https://github.com/apache/datafusion-comet/pull/2630#discussion_r2457677758
##########
spark/src/main/scala/org/apache/comet/serde/strings.scala:
##########
@@ -177,21 +187,16 @@ object CometStringRPad extends
CometExpressionSerde[StringRPad] {
object CometStringLPad extends CometExpressionSerde[StringLPad] {
- /**
- * Convert a Spark expression into a protocol buffer representation that can
be passed into
- * native code.
- *
- * @param expr
- * The Spark expression.
- * @param inputs
- * The input attributes.
- * @param binding
- * Whether the attributes are bound (this is only relevant in aggregate
expressions).
- * @return
- * Protocol buffer representation, or None if the expression could not be
converted. In this
- * case it is expected that the input expression will have been tagged
with reasons why it
- * could not be converted.
- */
+ override def getSupportLevel(expr: StringLPad): SupportLevel = {
+ if (expr.str.isInstanceOf[Literal]) {
+ return Unsupported(Some("Scalar values are not supported for the str
argument"))
+ }
+ if (!expr.pad.isInstanceOf[Literal]) {
Review Comment:
I suppose this is a good example of the benefit of fuzz testing (which is
how this issue was discovered). The fuzzer will generate test cases that most
developers would not consider. It does seem unlikely that anyone would want to
use a column for the pad value, but I suppose it is possible that someone may
have that requirement.
--
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]