Github user kiszk commented on a diff in the pull request: https://github.com/apache/spark/pull/19683#discussion_r151855849 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/GenerateExec.scala --- @@ -59,15 +61,23 @@ case class GenerateExec( generator: Generator, join: Boolean, outer: Boolean, + omitGeneratorChild: Boolean, generatorOutput: Seq[Attribute], child: SparkPlan) extends UnaryExecNode with CodegenSupport { + private def projectedChildOutput = generator match { + case g: UnaryExpression if omitGeneratorChild => + (child.output diff Seq(g.child)) + case _ => + child.output + } + override def output: Seq[Attribute] = { if (join) { - child.output ++ generatorOutput - } else { - generatorOutput + projectedChildOutput ++ generatorOutput + } else { --- End diff -- nit: do we need update indentation?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org