@@ -78,17 +78,23 @@ class PartitionBatchPruningSuite extends FunSuite with BeforeAndAfterAll with Be
7878 // Conjunction and disjunction
7979 checkBatchPruning(" SELECT key FROM pruningData WHERE key > 8 AND key <= 21" , 2 , 3 )(9 to 21 )
8080 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 )
8182 checkBatchPruning(" SELECT key FROM pruningData WHERE key < 2 OR (key > 78 AND key < 92)" , 3 , 4 ) {
8283 Seq (1 ) ++ (79 to 91 )
8384 }
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+ }
8490
8591 // 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-
8992 {
9093 val seq = (1 to 30 ).mkString(" , " )
9194 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+ }
9298 }
9399
94100 def checkBatchPruning (
0 commit comments