zhengruifeng commented on code in PR #48157:
URL: https://github.com/apache/spark/pull/48157#discussion_r1766148590


##########
sql/api/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -389,6 +389,18 @@ object functions {
   def count_min_sketch(e: Column, eps: Column, confidence: Column, seed: 
Column): Column =
     Column.fn("count_min_sketch", e, eps, confidence, seed)
 
+  /**
+   * Returns a count-min sketch of a column with the given esp, confidence and 
seed. The result is
+   * an array of bytes, which can be deserialized to a `CountMinSketch` before 
usage. Count-min
+   * sketch is a probabilistic data structure used for cardinality estimation 
using sub-linear
+   * space.
+   *
+   * @group agg_funcs
+   * @since 4.0.0
+   */
+  def count_min_sketch(e: Column, eps: Column, confidence: Column): Column =
+    count_min_sketch(e, eps, confidence, lit(SparkClassUtils.random.nextInt))

Review Comment:
   @HyukjinKwon it seems we don't have a separate `functions.scala` for Scala 
client now, after a lot of refactoring?



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