use of com.facebook.presto.spi.TestingColumnHandle in project presto by prestodb.
the class TestTableLayoutResult method testComputeEnforced.
@Test
public void testComputeEnforced() {
assertComputeEnforced(TupleDomain.all(), TupleDomain.all(), TupleDomain.all());
assertComputeEnforcedFails(TupleDomain.all(), TupleDomain.none());
assertComputeEnforced(TupleDomain.none(), TupleDomain.all(), TupleDomain.none());
assertComputeEnforced(TupleDomain.none(), TupleDomain.none(), TupleDomain.all());
assertComputeEnforced(TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L))), TupleDomain.all(), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L))));
assertComputeEnforced(TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L))), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L))), TupleDomain.all());
assertComputeEnforcedFails(TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L))), TupleDomain.none());
assertComputeEnforcedFails(TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L))), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 9999L))));
assertComputeEnforcedFails(TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L))), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c9999"), Domain.singleValue(BIGINT, 1L))));
assertComputeEnforced(TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L), new TestingColumnHandle("c2"), Domain.singleValue(BIGINT, 2L))), TupleDomain.all(), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L), new TestingColumnHandle("c2"), Domain.singleValue(BIGINT, 2L))));
assertComputeEnforced(TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L), new TestingColumnHandle("c2"), Domain.singleValue(BIGINT, 2L))), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L))), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c2"), Domain.singleValue(BIGINT, 2L))));
assertComputeEnforced(TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L), new TestingColumnHandle("c2"), Domain.singleValue(BIGINT, 2L))), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c2"), Domain.singleValue(BIGINT, 2L))), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L))));
assertComputeEnforced(TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L), new TestingColumnHandle("c2"), Domain.singleValue(BIGINT, 2L))), TupleDomain.withColumnDomains(ImmutableMap.of(new TestingColumnHandle("c1"), Domain.singleValue(BIGINT, 1L), new TestingColumnHandle("c2"), Domain.singleValue(BIGINT, 2L))), TupleDomain.all());
}
use of com.facebook.presto.spi.TestingColumnHandle in project presto by prestodb.
the class TestSchedulingOrderVisitor method testSemiJoinOrder.
@Test
public void testSemiJoinOrder() {
PlanBuilder planBuilder = new PlanBuilder(TEST_SESSION, new PlanNodeIdAllocator(), METADATA);
VariableReferenceExpression sourceJoin = planBuilder.variable("sourceJoin");
TableScanNode a = planBuilder.tableScan(ImmutableList.of(sourceJoin), ImmutableMap.of(sourceJoin, new TestingColumnHandle("sourceJoin")));
VariableReferenceExpression filteringSource = planBuilder.variable("filteringSource");
TableScanNode b = planBuilder.tableScan(ImmutableList.of(filteringSource), ImmutableMap.of(filteringSource, new TestingColumnHandle("filteringSource")));
List<PlanNodeId> order = scheduleOrder(planBuilder.semiJoin(sourceJoin, filteringSource, planBuilder.variable("semiJoinOutput"), Optional.empty(), Optional.empty(), a, b));
assertEquals(order, ImmutableList.of(b.getId(), a.getId()));
}
Aggregations