Skip to content
Closed
Show file tree
Hide file tree
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 @@ -78,7 +78,7 @@ case class GenerateExec(

override def outputPartitioning: Partitioning = child.outputPartitioning

val boundGenerator: Generator = BindReferences.bindReference(generator, child.output)
lazy val boundGenerator: Generator = BindReferences.bindReference(generator, child.output)

protected override def doExecute(): RDD[InternalRow] = {
// boundGenerator.terminate() should be triggered after all of the rows in the partition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ class StreamingAggregationSuite extends StateStoreMetricsTest with BeforeAndAfte
)
}

test("count distinct") {
val inputData = MemoryStream[(Int, Seq[Int])]

val aggregated =
inputData.toDF()
.select($"*", explode($"_2") as 'value)
.groupBy($"_1")
.agg(size(collect_set($"value")))
.as[(Int, Int)]

testStream(aggregated, Update)(
AddData(inputData, (1, Seq(1, 2))),
CheckLastBatch((1, 2))
)
}

test("simple count, complete mode") {
val inputData = MemoryStream[Int]

Expand Down