coderfender commented on code in PR #4111:
URL: https://github.com/apache/datafusion-comet/pull/4111#discussion_r3152052514


##########
spark/src/main/scala/org/apache/comet/serde/strings.scala:
##########
@@ -42,13 +42,27 @@ object CometStringRepeat extends 
CometExpressionSerde[StringRepeat] {
       inputs: Seq[Attribute],
       binding: Boolean): Option[ExprOuterClass.Expr] = {
     val children = expr.children
+
+    children(1) match {
+      case Literal(count, _) if isNegativeNumber(count) =>
+        withInfo(expr, "Negative repeat count is not supported")
+        return None
+      case _ =>

Review Comment:
   This will guard against negative repeat character but still goes through for 
positive counts with an error message . `getIncompatibleReasons()` is to add 
the right error message on documentation



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