Search in sources :

Example 1 with FULL

use of io.prestosql.spi.plan.JoinNode.Type.FULL in project hetu-core by openlookeng.

the class TestDetermineJoinDistributionType method testPartitionFullOuterJoin.

@Test
public void testPartitionFullOuterJoin() {
    int aRows = 10_000;
    int bRows = 10;
    assertDetermineJoinDistributionType().setSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.AUTOMATIC.name()).overrideStats("valuesA", PlanNodeStatsEstimate.builder().setOutputRowCount(aRows).addSymbolStatistics(ImmutableMap.of(new Symbol("A1"), new SymbolStatsEstimate(0, 100, 0, 640000, 100))).build()).overrideStats("valuesB", PlanNodeStatsEstimate.builder().setOutputRowCount(bRows).addSymbolStatistics(ImmutableMap.of(new Symbol("B1"), new SymbolStatsEstimate(0, 100, 0, 640000, 100))).build()).on(p -> p.join(FULL, p.values(new PlanNodeId("valuesA"), aRows, p.symbol("A1", BIGINT)), p.values(new PlanNodeId("valuesB"), bRows, p.symbol("B1", BIGINT)), ImmutableList.of(new JoinNode.EquiJoinClause(p.symbol("A1", BIGINT), p.symbol("B1", BIGINT))), ImmutableList.of(p.symbol("A1", BIGINT), p.symbol("B1", BIGINT)), Optional.empty())).matches(join(FULL, ImmutableList.of(equiJoinClause("A1", "B1")), Optional.empty(), Optional.of(PARTITIONED), values(ImmutableMap.of("A1", 0)), values(ImmutableMap.of("B1", 0))));
}
Also used : PlanBuilder.constantExpressions(io.prestosql.sql.planner.iterative.rule.test.PlanBuilder.constantExpressions) SymbolStatsEstimate(io.prestosql.cost.SymbolStatsEstimate) REPLICATED(io.prestosql.spi.plan.JoinNode.DistributionType.REPLICATED) PlanMatchPattern.equiJoinClause(io.prestosql.sql.planner.assertions.PlanMatchPattern.equiJoinClause) JoinDistributionType(io.prestosql.sql.analyzer.FeaturesConfig.JoinDistributionType) PlanMatchPattern.enforceSingleRow(io.prestosql.sql.planner.assertions.PlanMatchPattern.enforceSingleRow) Test(org.testng.annotations.Test) PARTITIONED(io.prestosql.spi.plan.JoinNode.DistributionType.PARTITIONED) PlanBuilder.castToRowExpression(io.prestosql.sql.planner.iterative.rule.test.PlanBuilder.castToRowExpression) PlanMatchPattern.values(io.prestosql.sql.planner.assertions.PlanMatchPattern.values) ImmutableList(com.google.common.collect.ImmutableList) RuleAssert(io.prestosql.sql.planner.iterative.rule.test.RuleAssert) BIGINT(io.prestosql.spi.type.BigintType.BIGINT) Type(io.prestosql.spi.plan.JoinNode.Type) JoinNode(io.prestosql.spi.plan.JoinNode) TaskCountEstimator(io.prestosql.cost.TaskCountEstimator) Symbol(io.prestosql.spi.plan.Symbol) PlanNodeId(io.prestosql.spi.plan.PlanNodeId) AfterClass(org.testng.annotations.AfterClass) PlanMatchPattern.join(io.prestosql.sql.planner.assertions.PlanMatchPattern.join) PlanNodeStatsEstimate(io.prestosql.cost.PlanNodeStatsEstimate) ImmutableMap(com.google.common.collect.ImmutableMap) FULL(io.prestosql.spi.plan.JoinNode.Type.FULL) BeforeClass(org.testng.annotations.BeforeClass) CostComparator(io.prestosql.cost.CostComparator) RIGHT(io.prestosql.spi.plan.JoinNode.Type.RIGHT) VarcharType.createUnboundedVarcharType(io.prestosql.spi.type.VarcharType.createUnboundedVarcharType) DistributionType(io.prestosql.spi.plan.JoinNode.DistributionType) INNER(io.prestosql.spi.plan.JoinNode.Type.INNER) Optional(java.util.Optional) JOIN_MAX_BROADCAST_TABLE_SIZE(io.prestosql.SystemSessionProperties.JOIN_MAX_BROADCAST_TABLE_SIZE) RuleTester(io.prestosql.sql.planner.iterative.rule.test.RuleTester) VarcharType(io.prestosql.spi.type.VarcharType) JOIN_DISTRIBUTION_TYPE(io.prestosql.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE) LEFT(io.prestosql.spi.plan.JoinNode.Type.LEFT) PlanNodeId(io.prestosql.spi.plan.PlanNodeId) Symbol(io.prestosql.spi.plan.Symbol) SymbolStatsEstimate(io.prestosql.cost.SymbolStatsEstimate) Test(org.testng.annotations.Test)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 JOIN_DISTRIBUTION_TYPE (io.prestosql.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE)1 JOIN_MAX_BROADCAST_TABLE_SIZE (io.prestosql.SystemSessionProperties.JOIN_MAX_BROADCAST_TABLE_SIZE)1 CostComparator (io.prestosql.cost.CostComparator)1 PlanNodeStatsEstimate (io.prestosql.cost.PlanNodeStatsEstimate)1 SymbolStatsEstimate (io.prestosql.cost.SymbolStatsEstimate)1 TaskCountEstimator (io.prestosql.cost.TaskCountEstimator)1 JoinNode (io.prestosql.spi.plan.JoinNode)1 DistributionType (io.prestosql.spi.plan.JoinNode.DistributionType)1 PARTITIONED (io.prestosql.spi.plan.JoinNode.DistributionType.PARTITIONED)1 REPLICATED (io.prestosql.spi.plan.JoinNode.DistributionType.REPLICATED)1 Type (io.prestosql.spi.plan.JoinNode.Type)1 FULL (io.prestosql.spi.plan.JoinNode.Type.FULL)1 INNER (io.prestosql.spi.plan.JoinNode.Type.INNER)1 LEFT (io.prestosql.spi.plan.JoinNode.Type.LEFT)1 RIGHT (io.prestosql.spi.plan.JoinNode.Type.RIGHT)1 PlanNodeId (io.prestosql.spi.plan.PlanNodeId)1 Symbol (io.prestosql.spi.plan.Symbol)1 BIGINT (io.prestosql.spi.type.BigintType.BIGINT)1