Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16954#discussion_r103853851
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala
 ---
    @@ -79,57 +251,10 @@ case class ScalarSubquery(
     object ScalarSubquery {
       def hasCorrelatedScalarSubquery(e: Expression): Boolean = {
         e.find {
    -      case e: ScalarSubquery if e.children.nonEmpty => true
    -      case _ => false
    -    }.isDefined
    -  }
    -}
    -
    -/**
    - * A predicate subquery checks the existence of a value in a sub-query. We 
currently only allow
    - * [[PredicateSubquery]] expressions within a Filter plan (i.e. WHERE or a 
HAVING clause). This will
    - * be rewritten into a left semi/anti join during analysis.
    - */
    -case class PredicateSubquery(
    -    plan: LogicalPlan,
    -    children: Seq[Expression] = Seq.empty,
    -    nullAware: Boolean = false,
    -    exprId: ExprId = NamedExpression.newExprId)
    -  extends SubqueryExpression with Predicate with Unevaluable {
    -  override lazy val resolved = childrenResolved && plan.resolved
    -  override lazy val references: AttributeSet = super.references -- 
plan.outputSet
    -  override def nullable: Boolean = nullAware
    -  override def withNewPlan(plan: LogicalPlan): PredicateSubquery = 
copy(plan = plan)
    -  override def semanticEquals(o: Expression): Boolean = o match {
    -    case p: PredicateSubquery =>
    -      plan.sameResult(p.plan) && nullAware == p.nullAware &&
    -        children.length == p.children.length &&
    -        children.zip(p.children).forall(p => p._1.semanticEquals(p._2))
    -    case _ => false
    -  }
    -  override def toString: String = s"predicate-subquery#${exprId.id} 
$conditionString"
    -}
    -
    -object PredicateSubquery {
    -  def hasPredicateSubquery(e: Expression): Boolean = {
    -    e.find {
    -      case _: PredicateSubquery | _: ListQuery | _: Exists => true
    +      case s: ScalarSubquery if s.children.nonEmpty => true
    --- End diff --
    
    `case s: ScalarSubquery => s.children.nonEmpty`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to