File tree Expand file tree Collapse file tree
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,10 +22,7 @@ import org.apache.spark.sql.catalyst.trees.TreeNode
2222import org .apache .spark .sql .internal .SQLConf
2323import org .apache .spark .sql .types .{DataType , StructType }
2424
25- abstract class QueryPlan [PlanType <: QueryPlan [PlanType ]]
26- extends TreeNode [PlanType ]
27- with QueryPlanConstraints [PlanType ] {
28-
25+ abstract class QueryPlan [PlanType <: QueryPlan [PlanType ]] extends TreeNode [PlanType ] {
2926 self : PlanType =>
3027
3128 def conf : SQLConf = SQLConf .get
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import org.apache.spark.sql.internal.SQLConf
2727import org .apache .spark .sql .types .StructType
2828
2929
30- abstract class LogicalPlan extends QueryPlan [LogicalPlan ] with Logging {
30+ abstract class LogicalPlan extends QueryPlan [LogicalPlan ] with QueryPlanConstraints with Logging {
3131
3232 private var _analyzed : Boolean = false
3333
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- package org .apache .spark .sql .catalyst .plans
18+ package org .apache .spark .sql .catalyst .plans . logical
1919
2020import org .apache .spark .sql .catalyst .expressions ._
2121
2222
23- trait QueryPlanConstraints [ PlanType <: QueryPlan [ PlanType ]] { self : QueryPlan [ PlanType ] =>
23+ trait QueryPlanConstraints { self : LogicalPlan =>
2424
2525 /**
2626 * An [[ExpressionSet ]] that contains invariants about the rows output by this operator. For
@@ -99,7 +99,8 @@ trait QueryPlanConstraints[PlanType <: QueryPlan[PlanType]] { self: QueryPlan[Pl
9999 private lazy val aliasMap : AttributeMap [Expression ] = AttributeMap (
100100 expressions.collect {
101101 case a : Alias => (a.toAttribute, a.child)
102- } ++ children.flatMap(_.asInstanceOf [QueryPlanConstraints [PlanType ]].aliasMap))
102+ } ++ children.flatMap(_.asInstanceOf [QueryPlanConstraints ].aliasMap))
103+ // Note: the explicit cast is necessary, since Scala compiler fails to infer the type.
103104
104105 /**
105106 * Infers an additional set of constraints from a given set of equality constraints.
You can’t perform that action at this time.
0 commit comments