Skip to content

Commit 65fa05a

Browse files
committed
Simplify scope of varibles as needed
1 parent a885907 commit 65fa05a

File tree

1 file changed

+2
-3
lines changed
  • sql/core/src/main/scala/org/apache/spark/sql/execution

1 file changed

+2
-3
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/objects.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,11 @@ case class MapElementsExec(
217217
}
218218

219219
override def doConsume(ctx: CodegenContext, input: Seq[ExprCode], row: ExprCode): String = {
220-
val inType = if (child.output.length == 1) child.output(0).dataType else NullType
221-
val outType = outputObjAttr.dataType
222220
val (funcClass, methodName) = func match {
223221
case m: MapFunction[_, _] => classOf[MapFunction[_, _]] -> "call"
224222
case _ =>
225-
(inType, outType) match {
223+
(if (child.output.length == 1) child.output(0).dataType else NullType,
224+
outputObjAttr.dataType) match {
226225
// if a pair of an argument and return types is one of specific types
227226
// whose specialized method (apply$mc..$sp) is generated by scalac,
228227
// Catalyst generated a direct method call to the specialized method.

0 commit comments

Comments
 (0)