viirya commented on a change in pull request #24675: [SPARK-27803][SQL][PYTHON]
Fix column pruning for Python UDF
URL: https://github.com/apache/spark/pull/24675#discussion_r286785463
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/pythonLogicalOperators.scala
##########
@@ -38,3 +38,30 @@ case class FlatMapGroupsInPandas(
*/
override val producedAttributes = AttributeSet(output)
}
+
+trait BaseEvalPython extends UnaryNode {
+
+ def udfs: Seq[PythonUDF]
+
+ def resultAttrs: Seq[Attribute]
+
+ override def output: Seq[Attribute] = child.output ++ resultAttrs
+
+ override def references: AttributeSet =
AttributeSet(udfs.flatMap(_.references))
Review comment:
If `references` only cover references in `udfs`, will some output attributes
from child that aren't referred by `udfs` be pruned from `BaseEvalPython`?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]