public static MaterializedDataPredicates differenceDataPredicates(
            MaterializedDataPredicates baseTablePredicatesInfo,
            MaterializedDataPredicates viewPredicatesInfo,
            Map<String, String> viewToBaseTablePredicatesKeyMap)
    {
        return differenceDataPredicates(baseTablePredicatesInfo, viewPredicatesInfo, viewToBaseTablePredicatesKeyMap, ImmutableMap.of());
    }
@Test
    public void testDifferenceDataPredicates()
    {
        TestingTypeManager typeManager = new TestingTypeManager();
        TestingSemiTransactionalHiveMetastore testMetastore = TestingSemiTransactionalHiveMetastore.create();

        List<String> keys = ImmutableList.of("ds");
        Column dsColumn = new Column("ds", HIVE_STRING, Optional.empty(), Optional.empty());
        List<Column> partitionColumns = ImmutableList.of(dsColumn);
        List<String> partitions = ImmutableList.of(
                "ds=2020-01-01",
                "ds=2020-01-02",
                "ds=2020-01-03",
                "ds=2020-01-04",
                "ds=2020-01-05",
                "ds=2020-01-06");

        testMetastore.setPartitionNames(partitions);

        MaterializedDataPredicates baseDataPredicates =
                getMaterializedDataPredicates(testMetastore, metastoreContext, typeManager, getTable(partitionColumns), DateTimeZone.UTC);

        List<String> viewPartitions = ImmutableList.of(
                "ds=2020-01-02",
                "ds=2020-01-03",
                "ds=2020-01-05");
        testMetastore.setPartitionNames(viewPartitions);

        MaterializedDataPredicates materializedDataPredicates =
                getMaterializedDataPredicates(testMetastore, metastoreContext, typeManager, getTable(partitionColumns), DateTimeZone.UTC);

        Map<String, String> materializedViewToBaseColumnMap = ImmutableMap.of("ds", "ds");

        ImmutableList.Builder<List<TestingPartitionResult>> partitionResults = ImmutableList.builder();
        partitionResults.add(ImmutableList.of(
                new TestingPartitionResult("ds", VARCHAR, "CAST('2020-01-01' AS varchar)")));
        partitionResults.add(ImmutableList.of(
                new TestingPartitionResult("ds", VARCHAR, "CAST('2020-01-04' AS varchar)")));
        partitionResults.add(ImmutableList.of(
                new TestingPartitionResult("ds", VARCHAR, "CAST('2020-01-06' AS varchar)")));

        MaterializedDataPredicates diffDataPredicates = differenceDataPredicates(baseDataPredicates, materializedDataPredicates, materializedViewToBaseColumnMap);
        comparePredicates(diffDataPredicates, keys, partitionResults.build());
    }