@Test public void testTrunctateDataPartitionedFilters() { File location = buildPartitionedTable("trunc", PARTITION_BY_FIRST_LETTER, "trunc1", "data"); DataSourceOptions options = new DataSourceOptions(ImmutableMap.of( "path", location.toString()) ); IcebergSource source = new IcebergSource(); DataSourceReader unfiltered = source.createReader(options); Assert.assertEquals("Unfiltered table should have created 9 read tasks", 9, planTasks(unfiltered).size()); { DataSourceReader reader = source.createReader(options); pushFilters(reader, Expressions.equal("data", "goldfish")); List<DataReaderFactory<UnsafeRow>> tasks = planTasks(reader); Assert.assertEquals("Should create 1 task for 'goldfish' (g)", 1, tasks.size()); } { DataSourceReader reader = source.createReader(options); pushFilters(reader, col("data").$eq$eq$eq("goldfish").expr()); List<DataReaderFactory<UnsafeRow>> tasks = planTasks(reader); Assert.assertEquals("Should create 1 task for 'goldfish' (g)", 1, tasks.size()); } assertEqualsSafe(SCHEMA.asStruct(), expected(9), read(location.toString(), "data = 'goldfish'")); }