@@ -78,17 +78,23 @@ class PartitionBatchPruningSuite extends FunSuite with BeforeAndAfterAll with Be
78
78
// Conjunction and disjunction
79
79
checkBatchPruning(" SELECT key FROM pruningData WHERE key > 8 AND key <= 21" , 2 , 3 )(9 to 21 )
80
80
checkBatchPruning(" SELECT key FROM pruningData WHERE key < 2 OR key > 99" , 2 , 2 )(Seq (1 , 100 ))
81
+ checkBatchPruning(" SELECT key FROM pruningData WHERE key < 12 AND key IS NOT NULL" , 1 , 2 )(1 to 11 )
81
82
checkBatchPruning(" SELECT key FROM pruningData WHERE key < 2 OR (key > 78 AND key < 92)" , 3 , 4 ) {
82
83
Seq (1 ) ++ (79 to 91 )
83
84
}
85
+ checkBatchPruning(" SELECT key FROM pruningData WHERE NOT (key < 88)" , 1 , 2 ) {
86
+ // Although the `NOT` operator isn't supported directly, the optimizer can transform
87
+ // `NOT (a < b)` to `b >= a`
88
+ 88 to 100
89
+ }
84
90
85
91
// With unsupported predicate
86
- checkBatchPruning(" SELECT key FROM pruningData WHERE NOT (key < 88)" , 1 , 2 )(88 to 100 )
87
- checkBatchPruning(" SELECT key FROM pruningData WHERE key < 12 AND key IS NOT NULL" , 1 , 2 )(1 to 11 )
88
-
89
92
{
90
93
val seq = (1 to 30 ).mkString(" , " )
91
94
checkBatchPruning(s " SELECT key FROM pruningData WHERE NOT (key IN ( $seq)) " , 5 , 10 )(31 to 100 )
95
+ checkBatchPruning(s " SELECT key FROM pruningData WHERE NOT (key IN ( $seq)) AND key > 88 " , 1 , 2 ) {
96
+ 89 to 100
97
+ }
92
98
}
93
99
94
100
def checkBatchPruning (
0 commit comments