bersprockets commented on code in PR #39945:
URL: https://github.com/apache/spark/pull/39945#discussion_r1107543671


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/maskExpressions.scala:
##########
@@ -223,16 +223,32 @@ case class Mask(
     val fifthGen = children(4).genCode(ctx)
     val resultCode =
       f(firstGen.value, secondGen.value, thirdGen.value, fourthGen.value, 
fifthGen.value)
-    ev.copy(
-      code = code"""
+    if (nullable) {

Review Comment:
   @gengliangwang With this function, only the first parameter affects whether 
NULL is returned. For the other parameters, NULL input has special meaning. An 
example from the doc:
   ```
         > SELECT _FUNC_('AbCD123-@$#', NULL, NULL, NULL, 'o');
           AbCD123oooo
   ```
   Mixing in `NullIntolerant` causes the above query to return NULL:
   ```
   spark-sql> SELECT MASK('AbCD123-@$#', NULL, NULL, NULL, 'o');
   NULL
   Time taken: 0.063 seconds, Fetched 1 row(s)
   ```
   



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