karuppayya commented on a change in pull request #28715:
URL: https://github.com/apache/spark/pull/28715#discussion_r440603564
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/GenerateExec.scala
##########
@@ -226,18 +226,33 @@ case class GenerateExec(
"0"
}
val numOutput = metricTerm(ctx, "numOutputRows")
+ val requiredInput =
+ evaluateRequiredVariablesExpr(child.output,
+ input, parent.inputSet) ++ position ++ values
s"""
|${data.code}
|$initMapData
|int $numElements = ${data.isNull} ? 0 : ${data.value}.numElements();
|for (int $index = $init; $index < $numElements; $index++) {
| $numOutput.add(1);
| $updateRowData
- | ${consume(ctx, input ++ position ++ values)}
+ | ${consume(ctx, requiredInput)}
|}
""".stripMargin
}
+ /**
+ * Returns [ExprCode] for required attributes
+ */
+ private def evaluateRequiredVariablesExpr(
Review comment:
This method is required when we either project all column or project
none of the columns(except for the exploded columns).
There were couple of test failure
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123751/testReport/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]