Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix or
  • Loading branch information
ulysses-you committed Jul 7, 2020
commit f45d6c31f8d4b840e212dd0561d97ba96e13b458
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ object OptimizeIn extends Rule[LogicalPlan] {
optimizeIn(expr, v, list)
} else if (convertible.nonEmpty && nonConvertible.nonEmpty) {
val optimizedIn = optimizeIn(In(v, convertible), v, convertible)
And(optimizedIn, In(v, nonConvertible))
Or(optimizedIn, In(v, nonConvertible))
} else {
expr
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class OptimizeInSuite extends PlanTest {
val correctAnswer1 =
testRelation
.where(
And(EqualTo(UnresolvedAttribute("a"), Literal(1)),
Or(EqualTo(UnresolvedAttribute("a"), Literal(1)),
In(UnresolvedAttribute("a"), Seq(UnresolvedAttribute("b"))))
)
.analyze
Expand Down