diff --git a/kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/PartitionPruningSuite.scala b/kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/PartitionPruningSuite.scala index d285a56b8f7..c8fcfbbbf9d 100644 --- a/kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/PartitionPruningSuite.scala +++ b/kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/PartitionPruningSuite.scala @@ -152,7 +152,59 @@ class PartitionPruningSuite extends AnyFunSuite with TestUtils { ) -> ( predicate("=", col("as_value"), ofString("200")), Seq() - ) + ), + + ( + "partition pruning: predicate with (unsupported expr OR data predicate)", + or( + predicate("=", col("as_value"), ofString("1")), // data col filter + predicate("unsupported") // unsupported expression + ) + ) -> ( + or( + predicate("=", col("as_value"), ofString("1")), // data col filter + predicate("unsupported") // unsupported expression + ), + Seq((18878, "0"), (18878, "1"), (null, "2")) + ), + + ( + "partition pruning: predicate with (unsupported expr OR partition predicate)", + or( + predicate("=", col("as_float"), ofFloat(1)), // partition col filter + predicate("unsupported") // unsupported expression + ) + ) -> ( + or( + predicate("=", col("as_float"), ofFloat(1)), // partition col filter + predicate("unsupported") // unsupported expression + ), + Seq((18878, "0"), (18878, "1"), (null, "2")) + ), + ( + "partition pruning: predicate with (unsupported expr AND data predicate)", + and( + predicate("=", col("as_value"), ofString("1")), // data col filter + predicate("unsupported") // unsupported expression + ) + ) -> ( + and( + predicate("=", col("as_value"), ofString("1")), // data col filter + predicate("unsupported") // unsupported expression + ), + Seq((18878, "0"), (18878, "1"), (null, "2")) + ), + + ( + "partition pruning: predicate with (unsupported expr AND partition predicate)", + and( + predicate("=", col("as_float"), ofFloat(1)), // partition col filter + predicate("unsupported") // unsupported expression + ) + ) -> ( + predicate("unsupported"), // unsupported expression + Seq((18878, "1")) + ), ) combinationTestCases.foreach { diff --git a/kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/utils/TestUtils.scala b/kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/utils/TestUtils.scala index 411014d00bf..8372884cca1 100644 --- a/kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/utils/TestUtils.scala +++ b/kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/utils/TestUtils.scala @@ -112,7 +112,7 @@ trait TestUtils extends Assertions { val scan = scanBuilder.build() if (filter != null) { - val actRemainingPredicate = scan.getRemainingFilter() + val actRemainingPredicate = scan.getRemainingFilter(defaultTableClient) assert( actRemainingPredicate.toString === Optional.ofNullable(expectedRemainingFilter).toString) }