You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by we...@apache.org on 2018/09/27 11:34:13 UTC

spark git commit: [SPARK-25551][SQL] Remove unused InSubquery expression

Repository: spark
Updated Branches:
  refs/heads/master 2a8cbfddb -> 86a2450e0


[SPARK-25551][SQL] Remove unused InSubquery expression

## What changes were proposed in this pull request?

The PR removes the `InSubquery` expression which was introduced a long time ago and its only usage was removed in https://github.com/apache/spark/commit/4ce970d71488c7de6025ef925f75b8b92a5a6a79. Hence it is not used anymore.

## How was this patch tested?

existing UTs

Closes #22556 from mgaido91/minor_insubq.

Authored-by: Marco Gaido <ma...@gmail.com>
Signed-off-by: Wenchen Fan <we...@databricks.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/86a2450e
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/86a2450e
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/86a2450e

Branch: refs/heads/master
Commit: 86a2450e09cbd3affbd66139ce4ed2b807e7b3b3
Parents: 2a8cbfd
Author: Marco Gaido <ma...@gmail.com>
Authored: Thu Sep 27 19:34:05 2018 +0800
Committer: Wenchen Fan <we...@databricks.com>
Committed: Thu Sep 27 19:34:05 2018 +0800

----------------------------------------------------------------------
 .../apache/spark/sql/execution/subquery.scala   | 43 --------------------
 1 file changed, 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/86a2450e/sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala
index d11045f..310ebcd 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala
@@ -91,49 +91,6 @@ case class ScalarSubquery(
 }
 
 /**
- * A subquery that will check the value of `child` whether is in the result of a query or not.
- */
-case class InSubquery(
-    child: Expression,
-    plan: SubqueryExec,
-    exprId: ExprId,
-    private var result: Array[Any] = null,
-    private var updated: Boolean = false) extends ExecSubqueryExpression {
-
-  override def dataType: DataType = BooleanType
-  override def children: Seq[Expression] = child :: Nil
-  override def nullable: Boolean = child.nullable
-  override def toString: String = s"$child IN ${plan.name}"
-  override def withNewPlan(plan: SubqueryExec): InSubquery = copy(plan = plan)
-
-  override def semanticEquals(other: Expression): Boolean = other match {
-    case in: InSubquery => child.semanticEquals(in.child) && plan.sameResult(in.plan)
-    case _ => false
-  }
-
-  def updateResult(): Unit = {
-    val rows = plan.executeCollect()
-    result = rows.map(_.get(0, child.dataType)).asInstanceOf[Array[Any]]
-    updated = true
-  }
-
-  override def eval(input: InternalRow): Any = {
-    require(updated, s"$this has not finished")
-    val v = child.eval(input)
-    if (v == null) {
-      null
-    } else {
-      result.contains(v)
-    }
-  }
-
-  override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
-    require(updated, s"$this has not finished")
-    InSet(child, result.toSet).doGenCode(ctx, ev)
-  }
-}
-
-/**
  * Plans scalar subqueries from that are present in the given [[SparkPlan]].
  */
 case class PlanSubqueries(sparkSession: SparkSession) extends Rule[SparkPlan] {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org