RyanBerti commented on code in PR #40615:
URL: https://github.com/apache/spark/pull/40615#discussion_r1172917855
##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -539,6 +539,235 @@ object functions {
def grouping_id(colName: String, colNames: String*): Column =
grouping_id((Seq(colName) ++ colNames).map(n => Column(n)): _*)
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch
+ * configured with lgConfigK and tgtHllType args.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_sketch_agg(e: Column, lgConfigK: Int, tgtHllType: String): Column =
+ Column.fn("hll_sketch_agg", e, lit(lgConfigK), lit(tgtHllType))
+
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch
+ * configured with lgConfigK and tgtHllType args.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_sketch_agg(columnName: String, lgConfigK: Int, tgtHllType: String):
Column =
+ Column.fn("hll_sketch_agg", Column(columnName), lit(lgConfigK),
lit(tgtHllType))
+
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch
+ * configured with lgConfigK arg and default tgtHllType value.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_sketch_agg(e: Column, lgConfigK: Int): Column =
+ Column.fn("hll_sketch_agg", e, lit(lgConfigK))
+
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch
+ * configured with lgConfigK arg and default tgtHllType value.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_sketch_agg(columnName: String, lgConfigK: Int): Column =
+ Column.fn("hll_sketch_agg", Column(columnName), lit(lgConfigK))
+
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch
+ * configured with default lgConfigK and tgtHllType values.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_sketch_agg(e: Column): Column =
+ Column.fn("hll_sketch_agg", e)
+
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch
+ * configured with default lgConfigK and tgtHllType values.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_sketch_agg(columnName: String): Column =
+ Column.fn("hll_sketch_agg", Column(columnName))
+
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch,
+ * generated by merging previously created Datasketches HllSketch instances
via a Datasketches
+ * Union instance configured with lgMaxK arg.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_union_agg(e: Column, lgMaxK: Int): Column =
+ Column.fn("hll_union_agg", e, lit(lgMaxK))
+
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch,
+ * generated by merging previously created Datasketches HllSketch instances
via a Datasketches
+ * Union instance configured with lgMaxK arg.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_union_agg(columnName: String, lgMaxK: Int): Column =
+ Column.fn("hll_union_agg", Column(columnName), lit(lgMaxK))
+
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch,
+ * generated by merging previously created Datasketches HllSketch instances
via a Datasketches
+ * Union instance configured with default lgMaxK arg.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_union_agg(e: Column): Column =
+ Column.fn("hll_union_agg", e)
+
+ /**
+ * Aggregate function: returns the compact binary representation of the
Datasketches HllSketch,
+ * generated by merging previously created Datasketches HllSketch instances
via a Datasketches
+ * Union instance configured with default lgMaxK arg.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hll_union_agg(columnName: String): Column =
+ Column.fn("hll_union_agg", Column(columnName))
+
+ /**
+ * Aggregate function: returns the estimated number of unique items in a
group, using a
+ * Datasketches HllSketch instance configured with lgConfigK and tgtHllType
args.
+ *
+ * @group agg_funcs
+ * @since 3.5.0
+ */
+ def hllsketch_estimate(columnName: String, lgConfigK: Int, tgtHllType:
String): Column = {
+ Column.fn("hllsketch_estimate", Column(columnName), lit(lgConfigK),
lit(tgtHllType))
+ }
Review Comment:
I think I copy/pasted these and forgot to remove the old definitions.
Removed.
--
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]