Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ abstract class Collect extends ImperativeAggregate {

override def inputAggBufferAttributes: Seq[AttributeReference] = Nil

// Both `CollectList` and `CollectSet` are non-deterministic since their results depend on the
// actual order of input rows.
override def deterministic: Boolean = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is collect_set non deterministic? It is backed by a HashSet, and the way elements are iterated over does not rely on the input order.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM. Actually iteration over a set is non-deterministic for values in the same hash bucket.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea. Also, there's no set type in Spark SQL, thus the result set is actually just a list without duplicated elements.


protected[this] val buffer: Growable[Any] with Iterable[Any]

override def initialize(b: MutableRow): Unit = {
Expand Down