Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/19506#discussion_r145741014
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproxCountDistinctForIntervals.scala
---
@@ -239,4 +221,23 @@ case class ApproxCountDistinctForIntervals(
override def dataType: DataType = ArrayType(LongType)
override def prettyName: String = "approx_count_distinct_for_intervals"
+
+ override def serialize(obj: Array[Long]): Array[Byte] = {
+ val buffer = ByteBuffer.wrap(new Array(obj.length * Longs.BYTES))
--- End diff --
IIRC `ByteBuffer` is pretty slow for writing, shall we use unsafe writing?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]