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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/maskExpressions.scala:
##########
@@ -236,40 +265,271 @@ case class Mask(
   }
 
   /**
-   * Returns the [[DataType]] of the result of evaluating this expression. It 
is invalid to query
-   * the dataType of an unresolved expression (i.e., when `resolved` == false).
+   * Returns a Seq of the children of this node. Children should not change. 
Immutability required
+   * for containsChild optimization
    */
-  override def dataType: DataType = StringType
+  override def children: Seq[Expression] =
+    Seq(input, upperCharExpr, lowerCharExpr, digitCharExpr, otherCharExpr)
+
+  override protected def withNewChildrenInternal(newChildren: 
IndexedSeq[Expression]): Mask =
+    copy(
+      input = newChildren(0),
+      upperCharExpr = newChildren(1),
+      lowerCharExpr = newChildren(2),
+      digitCharExpr = newChildren(3),
+      otherCharExpr = newChildren(4))
+}
+
+// scalastyle:off line.size.limit
+@ExpressionDescription(
+  usage =
+    """_FUNC_(input[, charCount, upperChar, lowerChar, digitChar, otherChar]) 
- masks the first n characters of given string value.
+       The function masks the first n characters of the value with 'X' or 'x', 
and numbers with 'n'.
+       This can be useful for creating copies of tables with sensitive 
information removed.

Review Comment:
   Done



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