You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2023/01/18 20:42:24 UTC

[GitHub] [spark] vinodkc commented on a diff in pull request #39577: [SPARK-42070][SQL] Change the default value of argument of Mask udf from -1 to NULL

vinodkc commented on code in PR #39577:
URL: https://github.com/apache/spark/pull/39577#discussion_r1080534998


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/maskExpressions.scala:
##########
@@ -207,6 +204,37 @@ case class Mask(
           s"transformInput($input, $upperChar, $lowerChar, $digitChar, $otherChar);"
       })
 
+  /**
+   * Short hand for generating quinary evaluation code. If either of the sub-expressions is null,
+   * the result of this computation is assumed to be null.
+   *
+   * @param f
+   *   function that accepts the 5 non-null evaluation result names of children and returns Java
+   *   code to compute the output.
+   */
+  override protected def nullSafeCodeGen(

Review Comment:
   nullSafeCodeGen here is an overridden  implementation to allow nulls value the input parameters (not filtering null values), null will be check later in mask method. 
   If we put this special implementation  in QuinaryExpression, future classed extending  QuinaryExpression will have to override it to handle null check.
   That is why overriding nullSafeCodeGen here



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

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


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