mgaido91 commented on a change in pull request #23562: [SPARK-26619][SQL] Prune
the unused serializers from SerializeFromObject
URL: https://github.com/apache/spark/pull/23562#discussion_r248304545
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -562,9 +562,8 @@ object ColumnPruning extends Rule[LogicalPlan] {
d.copy(child = prunedChild(child, d.references))
case p @ Project(_, s: SerializeFromObject) if p.references != s.outputSet
=>
- val prunedSerializer = s.serializer.filter { expr =>
- p.references.contains(expr.toAttribute)
- }
+ val usedRefs = p.references
+ val prunedSerializer = s.serializer.filter(e =>
usedRefs.contains(e.toAttribute))
Review comment:
nit: why `toAttribute`? I think it is not needed (see
https://github.com/apache/spark/blob/cf133e611020ed178f90358464a1b88cdd9b7889/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/AttributeSet.scala#L79)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]