Skip to content

Commit

Permalink
Revert "[SPARK-41732][SQL][SS] Apply tree-pattern based pruning for t…
Browse files Browse the repository at this point in the history
…he rule SessionWindowing"

This reverts commit 330befb.
  • Loading branch information
7mming7 committed Jul 27, 2023
1 parent 665dc0c commit b13a975
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3985,8 +3985,7 @@ object SessionWindowing extends Rule[LogicalPlan] {
* This also adds a marker to the session column so that downstream can easily find the column
* on session window.
*/
def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperatorsUpWithPruning(
_.containsPattern(SESSION_WINDOW), ruleId) {
def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperatorsUp {
case p: LogicalPlan if p.children.size == 1 =>
val child = p.children.head
val sessionExpressions =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.trees.TreePattern.{SESSION_WINDOW, TreePattern}
import org.apache.spark.sql.catalyst.util.IntervalUtils
import org.apache.spark.sql.types._
import org.apache.spark.unsafe.types.UTF8String
Expand Down Expand Up @@ -74,8 +73,6 @@ case class SessionWindow(timeColumn: Expression, gapDuration: Expression) extend
override def dataType: DataType = new StructType()
.add(StructField("start", TimestampType))
.add(StructField("end", TimestampType))
final override val nodePatterns: Seq[TreePattern] = Seq(SESSION_WINDOW)


// This expression is replaced in the analyzer.
override lazy val resolved = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ object RuleIdCollection {
"org.apache.spark.sql.catalyst.analysis.ResolveLambdaVariables" ::
"org.apache.spark.sql.catalyst.analysis.ResolveTimeZone" ::
"org.apache.spark.sql.catalyst.analysis.ResolveUnion" ::
"org.apache.spark.sql.catalyst.analysis.SessionWindowing" ::
"org.apache.spark.sql.catalyst.analysis.SubstituteUnresolvedOrdinals" ::
"org.apache.spark.sql.catalyst.analysis.TimeWindowing" ::
"org.apache.spark.sql.catalyst.analysis.TypeCoercionBase$CombinedTypeCoercionRule" ::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ object TreePattern extends Enumeration {
val RUNTIME_REPLACEABLE: Value = Value
val SCALAR_SUBQUERY: Value = Value
val SCALA_UDF: Value = Value
val SESSION_WINDOW: Value = Value
val SORT: Value = Value
val SUBQUERY_ALIAS: Value = Value
val SUM: Value = Value
Expand Down

0 comments on commit b13a975

Please sign in to comment.