Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21416#discussion_r190496061
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
---
@@ -220,6 +219,7 @@ object OptimizeIn extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
case q: LogicalPlan => q transformExpressionsDown {
case In(v, list) if list.isEmpty && !v.nullable => FalseLiteral
+ case In(v, list) if list.length == 1 => EqualTo(v, list.head)
--- End diff --
can we update the comment to mention it?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]