cloud-fan commented on a change in pull request #26629: [SPARK-29768][SQL] 
Column pruning through nondeterministic expressions 
URL: https://github.com/apache/spark/pull/26629#discussion_r350047808
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala
 ##########
 @@ -74,24 +95,70 @@ object PhysicalOperation extends PredicateHelper {
       case other =>
         (None, Nil, other, AttributeMap(Seq()))
     }
+}
 
-  private def collectAliases(fields: Seq[Expression]): 
AttributeMap[Expression] =
-    AttributeMap(fields.collect {
-      case a: Alias => (a.toAttribute, a.child)
-    })
-
-  private def substitute(aliases: AttributeMap[Expression])(expr: Expression): 
Expression = {
-    expr.transform {
-      case a @ Alias(ref: AttributeReference, name) =>
-        aliases.get(ref)
-          .map(Alias(_, name)(a.exprId, a.qualifier))
-          .getOrElse(a)
+/**
+ * Unlike PhysicalOperation, this operation would firstly search the first 
non-Project
 
 Review comment:
   A variant of [[PhysicalOperation]]. It matches any number of project or 
filter operations even if they are non-deterministic, as long as they satisfy 
the requirement of `CollapseProject` and `CombineFilters`

----------------------------------------------------------------
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]

Reply via email to