cloud-fan commented on a change in pull request #26629: [WIP][SPARK-29768][SQL] Columnar pruning through nondeterministic expressions URL: https://github.com/apache/spark/pull/26629#discussion_r349430791
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala ########## @@ -74,24 +95,66 @@ 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) - }) +object FileSourceOperation extends OperationHelper with PredicateHelper { - 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) + private val invalid: LogicalPlan => (Option[Seq[NamedExpression]], Seq[Expression], Review comment: another idea: maybe we can make the entire thing `Option`, and use `None` to indicate invalid. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org