Skip to content

Commit ffcd132

Browse files
author
Davies Liu
committed
address comments
1 parent 1b95be4 commit ffcd132

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class CodeGenContext {
271271
* Splits the generated code of expressions into multiple functions, because function has
272272
* 64kb code size limit in JVM
273273
*/
274-
def splitExpressions(input: String, expressions: Seq[String]): String = {
274+
def splitExpressions(row: String, expressions: Seq[String]): String = {
275275
val blocks = new ArrayBuffer[String]()
276276
val blockBuilder = new StringBuilder()
277277
for (code <- expressions) {
@@ -292,15 +292,15 @@ class CodeGenContext {
292292
val functions = blocks.zipWithIndex.map { case (body, i) =>
293293
val name = s"${apply}_$i"
294294
val code = s"""
295-
|private void $name(InternalRow $input) {
295+
|private void $name(InternalRow $row) {
296296
| $body
297297
|}
298298
""".stripMargin
299299
addNewFunction(name, code)
300300
name
301301
}
302302

303-
functions.map(name => s"$name($input);").mkString("\n")
303+
functions.map(name => s"$name($row);").mkString("\n")
304304
}
305305
}
306306
}

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/GeneratedProjectionSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import org.apache.spark.unsafe.types.UTF8String
2929
class GeneratedProjectionSuite extends SparkFunSuite {
3030

3131
test("generated projections on wider table") {
32-
val N = 10
32+
val N = 1000
3333
val wideRow1 = new GenericInternalRow((1 to N).toArray[Any])
3434
val schema1 = StructType((1 to N).map(i => StructField("", IntegerType)))
3535
val wideRow2 = new GenericInternalRow(

0 commit comments

Comments
 (0)