@VisibleForTesting
    static TupleDomain<Subfield> canonicalizeDomainPredicate(TupleDomain<Subfield> domainPredicate, Map<String, HiveColumnHandle> predicateColumns, PlanCanonicalizationStrategy strategy)
    {
        if (strategy == PlanCanonicalizationStrategy.DEFAULT) {
            return domainPredicate.canonicalize(ignored -> false);
        }
        return domainPredicate
                .transform(subfield -> {
                    if (!subfield.getPath().isEmpty() || !predicateColumns.containsKey(subfield.getRootName())) {
                        return subfield;
                    }
                    return isPartitionKey(predicateColumns.get(subfield.getRootName())) || strategy.equals(PlanCanonicalizationStrategy.IGNORE_SCAN_CONSTANTS) ? null : subfield;
                })
                .canonicalize(ignored -> false);
    }
@Test
    public void testCanonicalizeDomain()
    {
        Map<String, HiveColumnHandle> predicateColumns = ImmutableMap.of(
                "ds", getColumnHandle("ds", true),
                "col", getColumnHandle("col", false));
        TupleDomain<Subfield> domain = TupleDomain.withColumnDomains(ImmutableMap.of(
                new Subfield("ds"), singleValue(VARCHAR, utf8Slice("2022-01-01")),
                new Subfield("col"), singleValue(VARCHAR, utf8Slice("id"))));
        TupleDomain<Subfield> newDomain = canonicalizeDomainPredicate(domain, predicateColumns, CONNECTOR);
        assertTrue(newDomain.getDomains().isPresent());
        assertEquals(newDomain.getDomains().get().size(), 1);
        assertEquals(newDomain.getDomains().get().get(new Subfield("col")), singleValue(VARCHAR, utf8Slice("id")));
    }