Skip to content

Commit 0d982d2

Browse files
committed
fix
1 parent bbf63c9 commit 0d982d2

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ object ReorderAssociativeOperator extends Rule[LogicalPlan] {
230230
* Optimize IN predicates:
231231
* 1. Converts the predicate to false when the list is empty and
232232
* the value is not nullable.
233-
* 2. Removes literal repetitions.
234-
* 3. Replaces [[In (value, seq[Literal])]] with optimized version
233+
* 2. Extract convertible part from list.
234+
* 3. Removes literal repetitions.
235+
* 4. Replaces [[In (value, seq[Literal])]] with optimized version
235236
* [[InSet (value, HashSet[Literal])]] which is much faster.
236237
*/
237238
object OptimizeIn extends Rule[LogicalPlan] {

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/OptimizeInSuite.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ class OptimizeInSuite extends PlanTest {
9191
comparePlans(optimized, correctAnswer)
9292
}
9393

94-
test("OptimizedIn test: In clause not optimized in case filter has attributes") {
95-
val originalQuery =
96-
testRelation
97-
.where(In(UnresolvedAttribute("a"), Seq(Literal(1), Literal(2), UnresolvedAttribute("b"))))
98-
.analyze
99-
100-
val optimized = Optimize.execute(originalQuery.analyze)
101-
val correctAnswer =
102-
testRelation
103-
.where(In(UnresolvedAttribute("a"), Seq(Literal(1), Literal(2), UnresolvedAttribute("b"))))
104-
.analyze
105-
106-
comparePlans(optimized, correctAnswer)
107-
}
108-
10994
test("OptimizedIn test: NULL IN (expr1, ..., exprN) gets transformed to Filter(null)") {
11095
val originalQuery =
11196
testRelation

0 commit comments

Comments
 (0)