Skip to content
Snippets Groups Projects
Commit 2cdd92a7 authored by Cheng Lian's avatar Cheng Lian Committed by Wenchen Fan
Browse files

[SPARK-17182][SQL] Mark Collect as non-deterministic

## What changes were proposed in this pull request?

This PR marks the abstract class `Collect` as non-deterministic since the results of `CollectList` and `CollectSet` depend on the actual order of input rows.

## How was this patch tested?

Existing test cases should be enough.

Author: Cheng Lian <lian@databricks.com>

Closes #14749 from liancheng/spark-17182-non-deterministic-collect.
parent 920806ab
No related branches found
No related tags found
No related merge requests found
......@@ -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
protected[this] val buffer: Growable[Any] with Iterable[Any]
override def initialize(b: MutableRow): Unit = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment