francis0407 commented on a change in pull request #23783: [SPARK-26854][SQL] 
Support ANY/SOME subquery
URL: https://github.com/apache/spark/pull/23783#discussion_r258362958
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ##########
 @@ -1477,12 +1477,12 @@ class Analyzer(
           resolveSubQuery(s, plans)(ScalarSubquery(_, _, exprId))
         case e @ Exists(sub, _, exprId) if !sub.resolved =>
           resolveSubQuery(e, plans)(Exists(_, _, exprId))
-        case InSubquery(values, l @ ListQuery(_, _, exprId, _))
+        case ps @ PredicateSubquery(values, l @ ListQuery(_, _, exprId, _), 
genCmp)
             if values.forall(_.resolved) && !l.resolved =>
           val expr = resolveSubQuery(l, plans)((plan, exprs) => {
             ListQuery(plan, exprs, exprId, plan.output)
           })
-          InSubquery(values, expr.asInstanceOf[ListQuery])
+          ps.makeCopy(Array(values, expr, genCmp))
 
 Review comment:
   We can't use `makeCopy` here.
   Since `makeCopy()` calls constructors, it will fail when calling 
`InSubquery`'s constructor which has two args instead of three.
   I think we should rematch `ps` here. Do you have any better suggestions?  
@maropu 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to