jmalkin commented on code in PR #9:
URL: https://github.com/apache/datasketches-spark/pull/9#discussion_r1908068952
##########
src/main/scala/org/apache/spark/sql/aggregate/KllMerge.scala:
##########
@@ -17,45 +17,70 @@
package org.apache.spark.sql.aggregate
+import org.apache.datasketches.memory.Memory
import org.apache.datasketches.kll.{KllSketch, KllDoublesSketch}
import org.apache.spark.SparkUnsupportedOperationException
import org.apache.spark.sql.catalyst.InternalRow
-import org.apache.spark.sql.catalyst.expressions.{ExpectsInputTypes,
Expression, ExpressionDescription}
+import org.apache.spark.sql.catalyst.expressions.{ExpectsInputTypes,
Expression, ExpressionDescription, Literal}
import
org.apache.spark.sql.catalyst.expressions.aggregate.TypedImperativeAggregate
-import org.apache.spark.sql.catalyst.trees.UnaryLike
-import org.apache.spark.sql.types.{AbstractDataType, DataType,
KllDoublesSketchType}
-import org.apache.datasketches.memory.Memory
+import org.apache.spark.sql.catalyst.trees.BinaryLike
+import org.apache.spark.sql.types.{AbstractDataType, DataType, IntegerType,
KllDoublesSketchType}
+import org.apache.spark.sql.catalyst.analysis.TypeCheckResult
/**
* The KllDoublesMergeAgg function utilizes a Datasketches KllDoublesSketch
instance to
* combine multiple sketches into a single sketch.
*
- * @param child child expression against which the sketch will be created
+ * @param left Expression from which the sketch will be merged
+ * @param right k, the size-accuracy trade-off parameter for the sketch, int
in range [1, 65535]
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
usage = """
- _FUNC_(expr, k) - Merges multiple KllDoublesSketch images and returns the
binary representation
+ _FUNC_(expr[, k]) - Merges multiple KllDoublesSketch images and returns
the binary representation
""",
examples = """
Examples:
- > SELECT kll_get_quantile(_FUNC_(sketch), 0.5) FROM (SELECT
kll_sketch_agg(col) as sketch FROM VALUES (1.0), (2.0) tab(col) UNION ALL
SELECT kll_sketch_agg(col) as sketch FROM VALUES (2.0), (3.0) tab(col));
+ > SELECT kll_get_quantile(_FUNC_(sketch), 200) FROM (SELECT
kll_sketch_agg(col) as sketch FROM VALUES (1.0), (2.0) tab(col) UNION ALL
SELECT kll_sketch_agg(col) as sketch FROM VALUES (2.0), (3.0) tab(col));
Review Comment:
reverted
--
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]