Skip to content

Commit fa461a5

Browse files
committed
Update Optimizer.scala
1 parent e34c28a commit fa461a5

File tree

1 file changed

+1
-9
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer

1 file changed

+1
-9
lines changed

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,8 @@ object ConstantFolding extends Rule[LogicalPlan] {
292292

293293
// Fold expressions that are foldable.
294294
case e if e.foldable => Literal.create(e.eval(null), e.dataType)
295-
296-
// Fold "literal in (item1, item2, ..., literal, ...)" into true or false directly when all
297-
// elements is literal.
298-
case InSet(Literal(v, _), hSet) => {
299-
val isExists = hSet.contains(v)
300-
if(isExists) Literal.create(true, BooleanType) else Literal.create(false, BooleanType)
301-
}
302295

303-
// Fold "literal in (item1, item2, ..., literal, ...)" into true directly when
304-
// not all elements is literal.
296+
// Fold "literal in (item1, item2, ..., literal, ...)" into true directly.
305297
case In(Literal(v, _), list) if list.exists {
306298
case Literal(candidate, _) if candidate == v => true
307299
case _ => false

0 commit comments

Comments
 (0)