Skip to content

Commit

Permalink
Fix: Fix codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
karuppayya committed Jun 12, 2020
1 parent b902f86 commit 086ba42
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,11 @@ case class HashAggregateExec(

val aggTime = metricTerm(ctx, "aggTime")
val beforeAgg = ctx.freshName("beforeAgg")
val spillInPartialAggregateDisabled = sqlContext.conf.spillInPartialAggregationDisabled
s"""
|if (!$initAgg) {
| $initAgg = true;
| $avoidSpillInPartialAggregateTerm = $spillInPartialAggregateDisabled;
| $createFastHashMap
| $hashMapTerm = $thisPlan.createHashMap();
| long $beforeAgg = System.nanoTime();
Expand Down Expand Up @@ -885,7 +887,6 @@ case class HashAggregateExec(
val oomeClassName = classOf[SparkOutOfMemoryError].getName

val thisPlan = ctx.addReferenceObj("plan", this)
val spillInPartialAggregateDisabled = sqlContext.conf.spillInPartialAggregationDisabled

val findOrInsertRegularHashMap: String =
s"""
Expand All @@ -900,9 +901,8 @@ case class HashAggregateExec(
|// Can't allocate buffer from the hash map. Spill the map and fallback to sort-based
|// aggregation after processing all input rows.
|if ($unsafeRowBuffer == null) {
| // If sort/spill to disk is disabled, do not create the sorter
| if (!$avoidSpillInPartialAggregateTerm && $spillInPartialAggregateDisabled) {
| $avoidSpillInPartialAggregateTerm = true;
| if ($avoidSpillInPartialAggregateTerm) {
| // If sort/spill to disk is disabled, do not sort/spil to disk
| $unsafeRowBuffer = (UnsafeRow) $thisPlan.getEmptyAggregationBuffer();
| } else {
| if ($sorterTerm == null) {
Expand Down

0 comments on commit 086ba42

Please sign in to comment.