Skip to content
Closed
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
Addressed feedback
  • Loading branch information
dbtsai committed Jul 16, 2018
commit 23fedd8d65cb51201e1f032c938671ebc21eb432
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ object OptimizeIn extends Rule[LogicalPlan] {
If(IsNotNull(v), FalseLiteral, Literal(null, BooleanType))
case expr @ In(v, list) if expr.inSetConvertible =>
val newList = ExpressionSet(list).toSeq
if (newList.length == 1) {
if (newList.length == 1 && !list.isInstanceOf[ListQuery]) {
EqualTo(v, newList.head)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail, since the schema mismatches when the data type is struct. The test cases were added a few days ago. #21425

} else if (newList.size > SQLConf.get.optimizerInSetConversionThreshold) {
} else if (newList.length > SQLConf.get.optimizerInSetConversionThreshold) {
val hSet = newList.map(e => e.eval(EmptyRow))
InSet(v, HashSet() ++ hSet)
} else if (newList.size < list.size) {
} else if (newList.length < list.length) {
expr.copy(list = newList)
} else { // newList.length == list.length
} else { // newList.length == list.length && newList.length > 1
expr
}
}
Expand Down