aboutsummaryrefslogtreecommitdiff
path: root/sql/core
diff options
context:
space:
mode:
authorTakuya UESHIN <ueshin@happy-camper.st>2016-10-03 21:48:58 -0700
committerReynold Xin <rxin@databricks.com>2016-10-03 21:48:58 -0700
commitb1b47274bfeba17a9e4e9acebd7385289f31f6c8 (patch)
treeefdc4ab1c4ff848253d55188a16d427e9a0e44b4 /sql/core
parentc571cfb2d0e1e224107fc3f0c672730cae9804cb (diff)
downloadspark-b1b47274bfeba17a9e4e9acebd7385289f31f6c8.tar.gz
spark-b1b47274bfeba17a9e4e9acebd7385289f31f6c8.tar.bz2
spark-b1b47274bfeba17a9e4e9acebd7385289f31f6c8.zip
[SPARK-17702][SQL] Code generation including too many mutable states exceeds JVM size limit.
## What changes were proposed in this pull request? Code generation including too many mutable states exceeds JVM size limit to extract values from `references` into fields in the constructor. We should split the generated extractions in the constructor into smaller functions. ## How was this patch tested? I added some tests to check if the generated codes for the expressions exceed or not. Author: Takuya UESHIN <ueshin@happy-camper.st> Closes #15275 from ueshin/issues/SPARK-17702.
Diffstat (limited to 'sql/core')
-rw-r--r--sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala
index fb57ed7692..62bf6f4a81 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala
@@ -316,14 +316,16 @@ case class WholeStageCodegenExec(child: SparkPlan) extends UnaryExecNode with Co
final class GeneratedIterator extends org.apache.spark.sql.execution.BufferedRowIterator {
private Object[] references;
+ private scala.collection.Iterator[] inputs;
${ctx.declareMutableStates()}
public GeneratedIterator(Object[] references) {
this.references = references;
}
- public void init(int index, scala.collection.Iterator inputs[]) {
+ public void init(int index, scala.collection.Iterator[] inputs) {
partitionIndex = index;
+ this.inputs = inputs;
${ctx.initMutableStates()}
}