anchovYu commented on code in PR #41864:
URL: https://github.com/apache/spark/pull/41864#discussion_r1258916558


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/maskExpressions.scala:
##########
@@ -344,4 +346,13 @@ object Mask extends SupportsNamedArguments {
       strArg, upperCharArg, lowerCharArg, digitCharArg, otherCharArg))
     Seq(functionSignature)
   }
+
+  override def build(funcName: String, expressions: Seq[Expression]): 
Expression = {
+    if (expressions.length < 1 || expressions.length > 5) {
+      throw QueryCompilationErrors.wrongNumArgsError(
+        funcName, Seq(1, 2, 3, 4, 5), expressions.length)
+    }
+    new Mask(expressions(0), expressions(1), expressions(2), expressions(3), 
expressions(4))

Review Comment:
   I think clearly define our plan on new functions that supports named 
arguments - what is our behavior when users use all positional arguments? New 
functions may only have one constructor without overloarding but with well 
defined function signatures, e.g. Seq(`a` required, `b` optional). If users 
only pass func(1), do we throw exception that it does not match the argument 
count, or do our framework just consider this 1 as `a`, and fill the `b` with 
default value?



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to