Skip to content
Closed
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 @@ -18,7 +18,7 @@
package org.apache.spark.sql.execution.aggregate

import org.apache.spark.TaskContext
import org.apache.spark.memory.TaskMemoryManager
import org.apache.spark.memory.{SparkOutOfMemoryError, TaskMemoryManager}
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.errors._
Expand Down Expand Up @@ -762,6 +762,8 @@ case class HashAggregateExec(
("true", "true", "", "")
}

val oomeClassName = classOf[SparkOutOfMemoryError].getName

val findOrInsertRegularHashMap: String =
s"""
|// generate grouping key
Expand All @@ -787,7 +789,7 @@ case class HashAggregateExec(
| $unsafeRowKeys, ${hashEval.value});
| if ($unsafeRowBuffer == null) {
| // failed to allocate the first page
| throw new OutOfMemoryError("No enough memory for aggregation");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opened a JIRA for banning this by a new lint rule: https://issues.apache.org/jira/browse/SPARK-25986

| throw new $oomeClassName("No enough memory for aggregation");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @ueshin . Is this the final place? If not, can we have a separate JIRA issue for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so based on my investigation. I grep-ed with "OutOfMemoryError" and checked the suspicious places.

| }
|}
""".stripMargin
Expand Down