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_r256806534
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
 ##########
 @@ -199,10 +211,76 @@ case class InSubquery(values: Seq[Expression], query: 
ListQuery)
   override def children: Seq[Expression] = values :+ query
   override def nullable: Boolean = children.exists(_.nullable)
   override def foldable: Boolean = children.forall(_.foldable)
+}
+
+object SubqueryPredicate {
+
+  /**
+   * Only be used in SubqueryPredicate, and will be rewrite as 
Not(EqualTo(left, right)).
+   */
+  case class NotEqualTo(left: Expression, right: Expression) extends 
BinaryComparison {
+
+    override def symbol: String = "!="
+  }
+
+  /**
+   * Rewrite `NotEqualTo` as `Not(EqualTo)` and reserve others.
+   */
+  def getComparisonExpression[T <: BinaryComparison : ClassTag](
 
 Review comment:
   To avoid this weird logic, IMO we'd better to define an actual binary 
comparison expr in `AstBuilder` as I left the comment in 
https://github.com/apache/spark/pull/23783#discussion_r256804080

----------------------------------------------------------------
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