File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen
core/src/main/scala/org/apache/spark/sql/execution/aggregate Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ class CodegenContext {
243243 mutable.Map (outerClassName -> mutable.Map .empty[String , String ])
244244
245245 // Verbatim extra code to be added to the OuterClass.
246- private val extraCode : mutable.ListBuffer [String ] = mutable.ListBuffer [String ]()
246+ private val extraClasses : mutable.ListBuffer [String ] = mutable.ListBuffer [String ]()
247247
248248 // Returns the size of the most recently added class.
249249 private def currClassSize (): Int = classSize(classes.head._1)
@@ -335,16 +335,15 @@ class CodegenContext {
335335 * Emits any source code added with addExtraCode
336336 */
337337 def emitExtraCode (): String = {
338- extraCode .mkString(" \n " )
338+ extraClasses .mkString(" \n " )
339339 }
340340
341341 /**
342342 * Add extra source code to the outermost generated class.
343- * @param code verbatim source code to be added.
343+ * @param code verbatim source code of the inner class to be added.
344344 */
345- def addExtraCode (code : String ): Unit = {
346- extraCode.append(code)
347- classSize(outerClassName) += code.length
345+ def addInnerClass (code : String ): Unit = {
346+ extraClasses.append(code)
348347 }
349348
350349 final val JAVA_BOOLEAN = " boolean"
Original file line number Diff line number Diff line change @@ -621,7 +621,7 @@ case class HashAggregateExec(
621621 }
622622 } else " "
623623 }
624- ctx.addExtraCode (generateGenerateCode())
624+ ctx.addInnerClass (generateGenerateCode())
625625
626626 val doAgg = ctx.freshName(" doAggregateWithKeys" )
627627 val peakMemory = metricTerm(ctx, " peakMemory" )
You can’t perform that action at this time.
0 commit comments