Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix aggregate
  • Loading branch information
Davies Liu committed Feb 25, 2016
commit ca8fe0f5f55cabb1bb5903c3e85c150b31eaa7c7
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ private[sql] case class PhysicalRDD(
| while ($input.hasNext()) {
| InternalRow $row = (InternalRow) $input.next();
| $numOutputRows.add(1);
| ${columns.map(_.code).mkString("\n").trim}
| ${consume(ctx, columns).trim}
| if (shouldStop()) {
| return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,15 @@ case class TungstenAggregate(
val aggResults = functions.map(_.evaluateExpression).map { e =>
BindReferences.bindReference(e, aggregateBufferAttributes).gen(ctx)
}
val evaluateAggResults = evaluateVariables(aggResults)
// evaluate result expressions
ctx.currentVars = aggResults
val resultVars = resultExpressions.map { e =>
BindReferences.bindReference(e, aggregateAttributes).gen(ctx)
}
(resultVars, s"""
| ${evaluateVariables(aggResults)}
| ${evaluateVariables(resultVars)}
|$evaluateAggResults
|${evaluateVariables(resultVars)}
""".stripMargin)
} else if (modes.contains(Partial) || modes.contains(PartialMerge)) {
// output the aggregate buffer directly
Expand Down