Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21839#discussion_r204286954
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 ---
    @@ -450,13 +450,16 @@ object ColumnPruning extends Rule[LogicalPlan] {
         case d @ DeserializeToObject(_, _, child) if (child.outputSet -- 
d.references).nonEmpty =>
           d.copy(child = prunedChild(child, d.references))
     
    -    // Prunes the unused columns from child of Aggregate/Expand/Generate
    +    // Prunes the unused columns from child of 
Aggregate/Expand/Generate/ScriptTransformation
         case a @ Aggregate(_, _, child) if (child.outputSet -- 
a.references).nonEmpty =>
           a.copy(child = prunedChild(child, a.references))
         case f @ FlatMapGroupsInPandas(_, _, _, child) if (child.outputSet -- 
f.references).nonEmpty =>
           f.copy(child = prunedChild(child, f.references))
         case e @ Expand(_, _, child) if (child.outputSet -- 
e.references).nonEmpty =>
           e.copy(child = prunedChild(child, e.references))
    +    case s @ ScriptTransformation(_, _, _, child, _)
    +      if (child.outputSet -- s.references).nonEmpty =>
    --- End diff --
    
    Nit: two more spaces before `if`. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to