gengliangwang commented on code in PR #38511:
URL: https://github.com/apache/spark/pull/38511#discussion_r1023241331
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala:
##########
@@ -29,26 +29,13 @@ import org.apache.spark.sql.errors.QueryCompilationErrors
import org.apache.spark.sql.execution.datasources.v2.{DataSourceV2Relation,
DataSourceV2ScanRelation}
import org.apache.spark.sql.internal.SQLConf
-/**
- * A pattern that 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.
- * All filter operators are collected and their conditions are broken up and
returned
- * together with the top project operator. [[Alias Aliases]] are
in-lined/substituted if
- * necessary.
- */
-object PhysicalOperation extends AliasHelper with PredicateHelper {
+trait OperationHelper extends AliasHelper with PredicateHelper {
import
org.apache.spark.sql.catalyst.optimizer.CollapseProject.canCollapseExpressions
- type ReturnType =
- (Seq[NamedExpression], Seq[Expression], LogicalPlan)
type IntermediateType =
- (Option[Seq[NamedExpression]], Seq[Expression], LogicalPlan,
AttributeMap[Alias])
+ (Option[Seq[NamedExpression]], Seq[Seq[Expression]], LogicalPlan,
AttributeMap[Alias])
- def unapply(plan: LogicalPlan): Option[ReturnType] = {
- val alwaysInline =
SQLConf.get.getConf(SQLConf.COLLAPSE_PROJECT_ALWAYS_INLINE)
- val (fields, filters, child, _) = collectProjectsAndFilters(plan,
alwaysInline)
- Some((fields.getOrElse(child.output), filters, child))
- }
+ protected def canKeepMultipleFilters: Boolean
Review Comment:
Nit: add a simple comment
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]