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

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala
 ##########
 @@ -179,6 +179,40 @@ class ExpressionParserSuite extends PlanTest {
       InSubquery(Seq('a), ListQuery(table("c").select('b))))
   }
 
+  test("any sub-query") {
+    // Since the `genCmp` is generated from `AstBuilder` as a lambda expression
+    // which is not equal to the original comparison expression like `EqualTo`,
+    // we need to extract it from the parsed expression.
+    def extractPredicate(expr: Expression): (Expression, Expression) => 
Expression = {
+      expr.asInstanceOf[AnySubquery].genCmp
+    }
+
+    val any_subquery = defaultParser.parseExpression("a < any (select b from 
c)")
+    compareExpressions(
 
 Review comment:
   plz use `assertEqual`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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