ImmutableList.copyOf(assignments.keySet()),
assignments,
null,
Optional.<GeneratedPartitions>of(new GeneratedPartitions(
TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
ImmutableList.<Partition>of(new Partition(DualConnector.CONNECTOR_ID, new DualPartition())))));
effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(1L), AE)));
// tupleDomainInput with descriptive partitions
node = new TableScanNode(
newId(),
DUAL_TABLE_HANDLE,
ImmutableList.copyOf(assignments.keySet()),
assignments,
null,
Optional.<GeneratedPartitions>of(new GeneratedPartitions(
TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
ImmutableList.<Partition>of(tupleDomainPartition(DualConnector.CONNECTOR_ID,
TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
scanAssignments.get(A), Domain.singleValue(1L),
scanAssignments.get(B), Domain.singleValue(2L))))))));
effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(2L), BE), equals(number(1L), AE)));
// generic tupleDomainInput with no matching partitions
node = new TableScanNode(
newId(),
DUAL_TABLE_HANDLE,
ImmutableList.copyOf(assignments.keySet()),
assignments,
null,
Optional.<GeneratedPartitions>of(new GeneratedPartitions(
TupleDomain.<ColumnHandle>all(),
ImmutableList.<Partition>of())));
effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
Assert.assertEquals(effectivePredicate, BooleanLiteral.FALSE_LITERAL);
// generic tupleDomainInput with non-descriptive partitions
node = new TableScanNode(
newId(),
DUAL_TABLE_HANDLE,
ImmutableList.copyOf(assignments.keySet()),
assignments,
null,
Optional.<GeneratedPartitions>of(new GeneratedPartitions(
TupleDomain.<ColumnHandle>all(),
ImmutableList.<Partition>of(new Partition(DualConnector.CONNECTOR_ID, new DualPartition())))));
effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
Assert.assertEquals(effectivePredicate, BooleanLiteral.TRUE_LITERAL);
// generic tupleDomainInput with descriptive partitions
node = new TableScanNode(