Skip to content
This repository was archived by the owner on Sep 18, 2023. It is now read-only.
Open
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 @@ -151,7 +151,7 @@ case class ColumnarHashAggregateExec(
}

var numRowsInput = 0
var hasNextCount = 0
var firstBatch = true
// now we can return this wholestagecodegen iter
val res = new Iterator[ColumnarBatch] {
var processed = false
Expand Down Expand Up @@ -201,17 +201,16 @@ case class ColumnarHashAggregateExec(
processed = true
}
override def hasNext: Boolean = {
hasNextCount += 1
if (!processed) process
if (skip_count) {
count_num_row > 0
} else if (skip_native) {
hasNextCount == 1
} else if (onlyResultExpressions && hasNextCount == 1) {
firstBatch
} else if (onlyResultExpressions && firstBatch) {
onlyResExpr = true
true
} else if (!onlyResultExpressions && groupingExpressions.isEmpty &&
numRowsInput == 0 && hasNextCount == 1) {
numRowsInput == 0 && firstBatch) {
emptyInput = true
true
} else {
Expand All @@ -220,6 +219,7 @@ case class ColumnarHashAggregateExec(
}

override def next(): ColumnarBatch = {
firstBatch = false
if (!processed) process
val beforeEval = System.nanoTime()
if (skip_native) {
Expand Down