Skip to content

Commit de2dbdc

Browse files
Yash DattaYash Datta
authored andcommitted
SPARK-7142: Adding test cases
1 parent 7ada093 commit de2dbdc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ class BooleanSimplificationSuite extends PlanTest with PredicateHelper {
8989
('a === 'b || 'b > 3 && 'a > 3 && 'a < 5))
9090
}
9191

92+
test("a && (!a || b)") {
93+
checkCondition(('a && (!('a) || 'b )), ('a && 'b))
94+
95+
checkCondition(('a && ('b || !('a) )), ('a && 'b))
96+
97+
checkCondition(((!('a) || 'b ) && 'a), ('b && 'a))
98+
99+
checkCondition((('b || !('a) ) && 'a), ('b && 'a))
100+
}
101+
102+
test("!(a && b) , !(a || b)") {
103+
checkCondition((!('a && 'b)), (!('a) || !('b)))
104+
105+
checkCondition(!('a || 'b), (!('a) && !('b)))
106+
}
107+
92108
private val caseInsensitiveAnalyzer =
93109
new Analyzer(EmptyCatalog, EmptyFunctionRegistry, new SimpleCatalystConf(false))
94110

0 commit comments

Comments
 (0)