Search in sources :

Example 6 with PlanNodeStatsEstimate

use of com.facebook.presto.cost.PlanNodeStatsEstimate in project presto by prestodb.

the class TestDetermineJoinDistributionType method testReplicatesWhenNotRestricted.

@Test
public void testReplicatesWhenNotRestricted() {
    int aRows = 10_000;
    int bRows = 10;
    PlanNodeStatsEstimate probeSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(aRows).addVariableStatistics(ImmutableMap.of(new VariableReferenceExpression(Optional.empty(), "A1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000, 10))).build();
    PlanNodeStatsEstimate buildSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(bRows).addVariableStatistics(ImmutableMap.of(new VariableReferenceExpression(Optional.empty(), "B1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000, 10))).build();
    // B table is small enough to be replicated in AUTOMATIC_RESTRICTED mode
    assertDetermineJoinDistributionType().setSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.AUTOMATIC.name()).setSystemProperty(JOIN_MAX_BROADCAST_TABLE_SIZE, "100MB").overrideStats("valuesA", probeSideStatsEstimate).overrideStats("valuesB", buildSideStatsEstimate).on(p -> p.join(INNER, p.values(new PlanNodeId("valuesA"), aRows, p.variable("A1", BIGINT)), p.values(new PlanNodeId("valuesB"), bRows, p.variable("B1", BIGINT)), ImmutableList.of(new JoinNode.EquiJoinClause(p.variable("A1", BIGINT), p.variable("B1", BIGINT))), ImmutableList.of(p.variable("A1", BIGINT), p.variable("B1", BIGINT)), Optional.empty())).matches(join(INNER, ImmutableList.of(equiJoinClause("A1", "B1")), Optional.empty(), Optional.of(REPLICATED), values(ImmutableMap.of("A1", 0)), values(ImmutableMap.of("B1", 0))));
    probeSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(aRows).addVariableStatistics(ImmutableMap.of(new VariableReferenceExpression(Optional.empty(), "A1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000d * 10000, 10))).build();
    buildSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(bRows).addVariableStatistics(ImmutableMap.of(new VariableReferenceExpression(Optional.empty(), "B1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000d * 10000, 10))).build();
    // B table exceeds AUTOMATIC_RESTRICTED limit therefore it is partitioned
    assertDetermineJoinDistributionType().setSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.AUTOMATIC.name()).setSystemProperty(JOIN_MAX_BROADCAST_TABLE_SIZE, "100MB").overrideStats("valuesA", probeSideStatsEstimate).overrideStats("valuesB", buildSideStatsEstimate).on(p -> p.join(INNER, p.values(new PlanNodeId("valuesA"), aRows, p.variable("A1", BIGINT)), p.values(new PlanNodeId("valuesB"), bRows, p.variable("B1", BIGINT)), ImmutableList.of(new JoinNode.EquiJoinClause(p.variable("A1", BIGINT), p.variable("B1", BIGINT))), ImmutableList.of(p.variable("A1", BIGINT), p.variable("B1", BIGINT)), Optional.empty())).matches(join(INNER, ImmutableList.of(equiJoinClause("A1", "B1")), Optional.empty(), Optional.of(PARTITIONED), values(ImmutableMap.of("A1", 0)), values(ImmutableMap.of("B1", 0))));
}
Also used : Type(com.facebook.presto.sql.planner.plan.JoinNode.Type) PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) PlanBuilder.castToRowExpression(com.facebook.presto.sql.planner.iterative.rule.test.PlanBuilder.castToRowExpression) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) Test(org.testng.annotations.Test) FULL(com.facebook.presto.sql.planner.plan.JoinNode.Type.FULL) PlanMatchPattern.join(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.join) JoinDistributionType(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType) ImmutableList(com.google.common.collect.ImmutableList) JOIN_MAX_BROADCAST_TABLE_SIZE(com.facebook.presto.SystemSessionProperties.JOIN_MAX_BROADCAST_TABLE_SIZE) PlanMatchPattern.equiJoinClause(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.equiJoinClause) PlanMatchPattern.enforceSingleRow(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.enforceSingleRow) RuleAssert(com.facebook.presto.sql.planner.iterative.rule.test.RuleAssert) TaskCountEstimator(com.facebook.presto.cost.TaskCountEstimator) DistributionType(com.facebook.presto.sql.planner.plan.JoinNode.DistributionType) JoinNode(com.facebook.presto.sql.planner.plan.JoinNode) AfterClass(org.testng.annotations.AfterClass) BIGINT(com.facebook.presto.common.type.BigintType.BIGINT) PlanNodeStatsEstimate(com.facebook.presto.cost.PlanNodeStatsEstimate) ImmutableMap(com.google.common.collect.ImmutableMap) BeforeClass(org.testng.annotations.BeforeClass) JOIN_DISTRIBUTION_TYPE(com.facebook.presto.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE) RIGHT(com.facebook.presto.sql.planner.plan.JoinNode.Type.RIGHT) PlanBuilder.constantExpressions(com.facebook.presto.sql.planner.iterative.rule.test.PlanBuilder.constantExpressions) REPLICATED(com.facebook.presto.sql.planner.plan.JoinNode.DistributionType.REPLICATED) LEFT(com.facebook.presto.sql.planner.plan.JoinNode.Type.LEFT) CostComparator(com.facebook.presto.cost.CostComparator) Optional(java.util.Optional) PlanMatchPattern.values(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.values) PARTITIONED(com.facebook.presto.sql.planner.plan.JoinNode.DistributionType.PARTITIONED) VariableStatsEstimate(com.facebook.presto.cost.VariableStatsEstimate) RuleTester(com.facebook.presto.sql.planner.iterative.rule.test.RuleTester) INNER(com.facebook.presto.sql.planner.plan.JoinNode.Type.INNER) PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) PlanNodeStatsEstimate(com.facebook.presto.cost.PlanNodeStatsEstimate) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) VariableStatsEstimate(com.facebook.presto.cost.VariableStatsEstimate) Test(org.testng.annotations.Test)

Example 7 with PlanNodeStatsEstimate

use of com.facebook.presto.cost.PlanNodeStatsEstimate in project presto by prestodb.

the class DetermineJoinDistributionType method isBelowMaxBroadcastSize.

public static boolean isBelowMaxBroadcastSize(JoinNode joinNode, Context context) {
    DataSize joinMaxBroadcastTableSize = getJoinMaxBroadcastTableSize(context.getSession());
    PlanNode buildSide = joinNode.getRight();
    PlanNodeStatsEstimate buildSideStatsEstimate = context.getStatsProvider().getStats(buildSide);
    double buildSideSizeInBytes = buildSideStatsEstimate.getOutputSizeInBytes(buildSide.getOutputVariables());
    return buildSideSizeInBytes <= joinMaxBroadcastTableSize.toBytes();
}
Also used : PlanNode(com.facebook.presto.spi.plan.PlanNode) PlanNodeStatsEstimate(com.facebook.presto.cost.PlanNodeStatsEstimate) DataSize(io.airlift.units.DataSize)

Example 8 with PlanNodeStatsEstimate

use of com.facebook.presto.cost.PlanNodeStatsEstimate in project presto by prestodb.

the class TestReorderJoins method testReplicatedScalarJoinEvenWhereSessionRequiresRepartitioned.

@Test
public void testReplicatedScalarJoinEvenWhereSessionRequiresRepartitioned() {
    PlanMatchPattern expectedPlan = join(INNER, ImmutableList.of(equiJoinClause("A1", "B1")), Optional.empty(), Optional.of(REPLICATED), values(ImmutableMap.of("A1", 0)), values(ImmutableMap.of("B1", 0)));
    PlanNodeStatsEstimate valuesA = PlanNodeStatsEstimate.builder().setOutputRowCount(10000).addVariableStatistics(ImmutableMap.of(variable("A1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000, 100))).build();
    PlanNodeStatsEstimate valuesB = PlanNodeStatsEstimate.builder().setOutputRowCount(10000).addVariableStatistics(ImmutableMap.of(variable("B1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000, 100))).build();
    assertReorderJoins().setSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.PARTITIONED.name()).on(p -> p.join(INNER, // matches isAtMostScalar
    p.values(new PlanNodeId("valuesA"), p.variable("A1")), p.values(new PlanNodeId("valuesB"), ImmutableList.of(p.variable("B1")), TWO_ROWS), ImmutableList.of(new EquiJoinClause(p.variable("A1"), p.variable("B1"))), ImmutableList.of(p.variable("A1"), p.variable("B1")), Optional.empty())).overrideStats("valuesA", valuesA).overrideStats("valuesB", valuesB).matches(expectedPlan);
    assertReorderJoins().setSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.PARTITIONED.name()).on(p -> p.join(INNER, p.values(new PlanNodeId("valuesB"), ImmutableList.of(p.variable("B1")), TWO_ROWS), // matches isAtMostScalar
    p.values(new PlanNodeId("valuesA"), p.variable("A1")), ImmutableList.of(new EquiJoinClause(p.variable("A1"), p.variable("B1"))), ImmutableList.of(p.variable("A1"), p.variable("B1")), Optional.empty())).overrideStats("valuesA", valuesA).overrideStats("valuesB", valuesB).matches(expectedPlan);
}
Also used : JoinReorderingStrategy(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinReorderingStrategy) EquiJoinClause(com.facebook.presto.sql.planner.plan.JoinNode.EquiJoinClause) PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) AUTOMATIC(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType.AUTOMATIC) QualifiedName(com.facebook.presto.sql.tree.QualifiedName) VARCHAR(com.facebook.presto.common.type.VarcharType.VARCHAR) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) Test(org.testng.annotations.Test) Expressions.call(com.facebook.presto.sql.relational.Expressions.call) PlanMatchPattern(com.facebook.presto.sql.planner.assertions.PlanMatchPattern) PlanMatchPattern.join(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.join) JoinDistributionType(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType) ImmutableList(com.google.common.collect.ImmutableList) JOIN_MAX_BROADCAST_TABLE_SIZE(com.facebook.presto.SystemSessionProperties.JOIN_MAX_BROADCAST_TABLE_SIZE) PlanMatchPattern.equiJoinClause(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.equiJoinClause) EQUAL(com.facebook.presto.common.function.OperatorType.EQUAL) LESS_THAN(com.facebook.presto.common.function.OperatorType.LESS_THAN) BOOLEAN(com.facebook.presto.common.type.BooleanType.BOOLEAN) FunctionResolution(com.facebook.presto.sql.relational.FunctionResolution) Expressions.variable(com.facebook.presto.sql.relational.Expressions.variable) RuleAssert(com.facebook.presto.sql.planner.iterative.rule.test.RuleAssert) FunctionAndTypeManager.qualifyObjectName(com.facebook.presto.metadata.FunctionAndTypeManager.qualifyObjectName) RowExpression(com.facebook.presto.spi.relation.RowExpression) AfterClass(org.testng.annotations.AfterClass) BIGINT(com.facebook.presto.common.type.BigintType.BIGINT) PlanNodeStatsEstimate(com.facebook.presto.cost.PlanNodeStatsEstimate) ImmutableMap(com.google.common.collect.ImmutableMap) BeforeClass(org.testng.annotations.BeforeClass) JOIN_DISTRIBUTION_TYPE(com.facebook.presto.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE) OperatorType(com.facebook.presto.common.function.OperatorType) List(java.util.List) REPLICATED(com.facebook.presto.sql.planner.plan.JoinNode.DistributionType.REPLICATED) JOIN_REORDERING_STRATEGY(com.facebook.presto.SystemSessionProperties.JOIN_REORDERING_STRATEGY) CostComparator(com.facebook.presto.cost.CostComparator) Optional(java.util.Optional) PlanMatchPattern.values(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.values) PARTITIONED(com.facebook.presto.sql.planner.plan.JoinNode.DistributionType.PARTITIONED) VariableStatsEstimate(com.facebook.presto.cost.VariableStatsEstimate) Closeables.closeAllRuntimeException(com.facebook.airlift.testing.Closeables.closeAllRuntimeException) RuleTester(com.facebook.presto.sql.planner.iterative.rule.test.RuleTester) BROADCAST(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType.BROADCAST) INNER(com.facebook.presto.sql.planner.plan.JoinNode.Type.INNER) PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) PlanNodeStatsEstimate(com.facebook.presto.cost.PlanNodeStatsEstimate) EquiJoinClause(com.facebook.presto.sql.planner.plan.JoinNode.EquiJoinClause) PlanMatchPattern(com.facebook.presto.sql.planner.assertions.PlanMatchPattern) VariableStatsEstimate(com.facebook.presto.cost.VariableStatsEstimate) Test(org.testng.annotations.Test)

Example 9 with PlanNodeStatsEstimate

use of com.facebook.presto.cost.PlanNodeStatsEstimate in project presto by prestodb.

the class TestReorderJoins method testReplicatesWhenNotRestricted.

@Test
public void testReplicatesWhenNotRestricted() {
    int aRows = 10_000;
    int bRows = 10;
    PlanNodeStatsEstimate probeSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(aRows).addVariableStatistics(ImmutableMap.of(variable("A1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000, 10))).build();
    PlanNodeStatsEstimate buildSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(bRows).addVariableStatistics(ImmutableMap.of(variable("B1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000, 10))).build();
    // B table is small enough to be replicated in AUTOMATIC_RESTRICTED mode
    assertReorderJoins().setSystemProperty(JOIN_DISTRIBUTION_TYPE, AUTOMATIC.name()).setSystemProperty(JOIN_MAX_BROADCAST_TABLE_SIZE, "100MB").on(p -> p.join(INNER, p.values(new PlanNodeId("valuesA"), aRows, p.variable("A1")), p.values(new PlanNodeId("valuesB"), bRows, p.variable("B1")), ImmutableList.of(new EquiJoinClause(p.variable("A1"), p.variable("B1"))), ImmutableList.of(p.variable("A1"), p.variable("B1")), Optional.empty())).overrideStats("valuesA", probeSideStatsEstimate).overrideStats("valuesB", buildSideStatsEstimate).matches(join(INNER, ImmutableList.of(equiJoinClause("A1", "B1")), Optional.empty(), Optional.of(REPLICATED), values(ImmutableMap.of("A1", 0)), values(ImmutableMap.of("B1", 0))));
    probeSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(aRows).addVariableStatistics(ImmutableMap.of(variable("A1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000d * 10000, 10))).build();
    buildSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(bRows).addVariableStatistics(ImmutableMap.of(variable("B1", BIGINT), new VariableStatsEstimate(0, 100, 0, 640000d * 10000, 10))).build();
    // B table exceeds AUTOMATIC_RESTRICTED limit therefore it is partitioned
    assertReorderJoins().setSystemProperty(JOIN_DISTRIBUTION_TYPE, AUTOMATIC.name()).setSystemProperty(JOIN_MAX_BROADCAST_TABLE_SIZE, "100MB").on(p -> p.join(INNER, p.values(new PlanNodeId("valuesA"), aRows, p.variable("A1")), p.values(new PlanNodeId("valuesB"), bRows, p.variable("B1")), ImmutableList.of(new EquiJoinClause(p.variable("A1"), p.variable("B1"))), ImmutableList.of(p.variable("A1"), p.variable("B1")), Optional.empty())).overrideStats("valuesA", probeSideStatsEstimate).overrideStats("valuesB", buildSideStatsEstimate).matches(join(INNER, ImmutableList.of(equiJoinClause("A1", "B1")), Optional.empty(), Optional.of(PARTITIONED), values(ImmutableMap.of("A1", 0)), values(ImmutableMap.of("B1", 0))));
}
Also used : JoinReorderingStrategy(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinReorderingStrategy) EquiJoinClause(com.facebook.presto.sql.planner.plan.JoinNode.EquiJoinClause) PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) AUTOMATIC(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType.AUTOMATIC) QualifiedName(com.facebook.presto.sql.tree.QualifiedName) VARCHAR(com.facebook.presto.common.type.VarcharType.VARCHAR) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) Test(org.testng.annotations.Test) Expressions.call(com.facebook.presto.sql.relational.Expressions.call) PlanMatchPattern(com.facebook.presto.sql.planner.assertions.PlanMatchPattern) PlanMatchPattern.join(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.join) JoinDistributionType(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType) ImmutableList(com.google.common.collect.ImmutableList) JOIN_MAX_BROADCAST_TABLE_SIZE(com.facebook.presto.SystemSessionProperties.JOIN_MAX_BROADCAST_TABLE_SIZE) PlanMatchPattern.equiJoinClause(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.equiJoinClause) EQUAL(com.facebook.presto.common.function.OperatorType.EQUAL) LESS_THAN(com.facebook.presto.common.function.OperatorType.LESS_THAN) BOOLEAN(com.facebook.presto.common.type.BooleanType.BOOLEAN) FunctionResolution(com.facebook.presto.sql.relational.FunctionResolution) Expressions.variable(com.facebook.presto.sql.relational.Expressions.variable) RuleAssert(com.facebook.presto.sql.planner.iterative.rule.test.RuleAssert) FunctionAndTypeManager.qualifyObjectName(com.facebook.presto.metadata.FunctionAndTypeManager.qualifyObjectName) RowExpression(com.facebook.presto.spi.relation.RowExpression) AfterClass(org.testng.annotations.AfterClass) BIGINT(com.facebook.presto.common.type.BigintType.BIGINT) PlanNodeStatsEstimate(com.facebook.presto.cost.PlanNodeStatsEstimate) ImmutableMap(com.google.common.collect.ImmutableMap) BeforeClass(org.testng.annotations.BeforeClass) JOIN_DISTRIBUTION_TYPE(com.facebook.presto.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE) OperatorType(com.facebook.presto.common.function.OperatorType) List(java.util.List) REPLICATED(com.facebook.presto.sql.planner.plan.JoinNode.DistributionType.REPLICATED) JOIN_REORDERING_STRATEGY(com.facebook.presto.SystemSessionProperties.JOIN_REORDERING_STRATEGY) CostComparator(com.facebook.presto.cost.CostComparator) Optional(java.util.Optional) PlanMatchPattern.values(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.values) PARTITIONED(com.facebook.presto.sql.planner.plan.JoinNode.DistributionType.PARTITIONED) VariableStatsEstimate(com.facebook.presto.cost.VariableStatsEstimate) Closeables.closeAllRuntimeException(com.facebook.airlift.testing.Closeables.closeAllRuntimeException) RuleTester(com.facebook.presto.sql.planner.iterative.rule.test.RuleTester) BROADCAST(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType.BROADCAST) INNER(com.facebook.presto.sql.planner.plan.JoinNode.Type.INNER) PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) PlanNodeStatsEstimate(com.facebook.presto.cost.PlanNodeStatsEstimate) EquiJoinClause(com.facebook.presto.sql.planner.plan.JoinNode.EquiJoinClause) VariableStatsEstimate(com.facebook.presto.cost.VariableStatsEstimate) Test(org.testng.annotations.Test)

Example 10 with PlanNodeStatsEstimate

use of com.facebook.presto.cost.PlanNodeStatsEstimate in project presto by prestodb.

the class TestReorderJoins method testReorderAndReplicate.

@Test
public void testReorderAndReplicate() {
    int aRows = 10;
    int bRows = 10_000;
    PlanNodeStatsEstimate probeSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(aRows).addVariableStatistics(ImmutableMap.of(variable("A1", VARCHAR), new VariableStatsEstimate(0, 100, 0, 640000, 10))).build();
    PlanNodeStatsEstimate buildSideStatsEstimate = PlanNodeStatsEstimate.builder().setOutputRowCount(bRows).addVariableStatistics(ImmutableMap.of(variable("B1", VARCHAR), new VariableStatsEstimate(0, 100, 0, 640000, 10))).build();
    // A table is small enough to be replicated in AUTOMATIC_RESTRICTED mode
    assertReorderJoins().setSystemProperty(JOIN_DISTRIBUTION_TYPE, AUTOMATIC.name()).setSystemProperty(JOIN_REORDERING_STRATEGY, AUTOMATIC.name()).setSystemProperty(JOIN_MAX_BROADCAST_TABLE_SIZE, "10MB").on(p -> {
        VariableReferenceExpression a1 = p.variable("A1", VARCHAR);
        VariableReferenceExpression b1 = p.variable("B1", VARCHAR);
        return p.join(INNER, p.values(new PlanNodeId("valuesA"), aRows, a1), p.values(new PlanNodeId("valuesB"), bRows, b1), ImmutableList.of(new EquiJoinClause(a1, b1)), ImmutableList.of(a1, b1), Optional.empty());
    }).overrideStats("valuesA", probeSideStatsEstimate).overrideStats("valuesB", buildSideStatsEstimate).matches(join(INNER, ImmutableList.of(equiJoinClause("B1", "A1")), Optional.empty(), Optional.of(REPLICATED), values(ImmutableMap.of("B1", 0)), values(ImmutableMap.of("A1", 0))));
}
Also used : JoinReorderingStrategy(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinReorderingStrategy) EquiJoinClause(com.facebook.presto.sql.planner.plan.JoinNode.EquiJoinClause) PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) AUTOMATIC(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType.AUTOMATIC) QualifiedName(com.facebook.presto.sql.tree.QualifiedName) VARCHAR(com.facebook.presto.common.type.VarcharType.VARCHAR) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) Test(org.testng.annotations.Test) Expressions.call(com.facebook.presto.sql.relational.Expressions.call) PlanMatchPattern(com.facebook.presto.sql.planner.assertions.PlanMatchPattern) PlanMatchPattern.join(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.join) JoinDistributionType(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType) ImmutableList(com.google.common.collect.ImmutableList) JOIN_MAX_BROADCAST_TABLE_SIZE(com.facebook.presto.SystemSessionProperties.JOIN_MAX_BROADCAST_TABLE_SIZE) PlanMatchPattern.equiJoinClause(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.equiJoinClause) EQUAL(com.facebook.presto.common.function.OperatorType.EQUAL) LESS_THAN(com.facebook.presto.common.function.OperatorType.LESS_THAN) BOOLEAN(com.facebook.presto.common.type.BooleanType.BOOLEAN) FunctionResolution(com.facebook.presto.sql.relational.FunctionResolution) Expressions.variable(com.facebook.presto.sql.relational.Expressions.variable) RuleAssert(com.facebook.presto.sql.planner.iterative.rule.test.RuleAssert) FunctionAndTypeManager.qualifyObjectName(com.facebook.presto.metadata.FunctionAndTypeManager.qualifyObjectName) RowExpression(com.facebook.presto.spi.relation.RowExpression) AfterClass(org.testng.annotations.AfterClass) BIGINT(com.facebook.presto.common.type.BigintType.BIGINT) PlanNodeStatsEstimate(com.facebook.presto.cost.PlanNodeStatsEstimate) ImmutableMap(com.google.common.collect.ImmutableMap) BeforeClass(org.testng.annotations.BeforeClass) JOIN_DISTRIBUTION_TYPE(com.facebook.presto.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE) OperatorType(com.facebook.presto.common.function.OperatorType) List(java.util.List) REPLICATED(com.facebook.presto.sql.planner.plan.JoinNode.DistributionType.REPLICATED) JOIN_REORDERING_STRATEGY(com.facebook.presto.SystemSessionProperties.JOIN_REORDERING_STRATEGY) CostComparator(com.facebook.presto.cost.CostComparator) Optional(java.util.Optional) PlanMatchPattern.values(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.values) PARTITIONED(com.facebook.presto.sql.planner.plan.JoinNode.DistributionType.PARTITIONED) VariableStatsEstimate(com.facebook.presto.cost.VariableStatsEstimate) Closeables.closeAllRuntimeException(com.facebook.airlift.testing.Closeables.closeAllRuntimeException) RuleTester(com.facebook.presto.sql.planner.iterative.rule.test.RuleTester) BROADCAST(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType.BROADCAST) INNER(com.facebook.presto.sql.planner.plan.JoinNode.Type.INNER) PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) PlanNodeStatsEstimate(com.facebook.presto.cost.PlanNodeStatsEstimate) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) EquiJoinClause(com.facebook.presto.sql.planner.plan.JoinNode.EquiJoinClause) VariableStatsEstimate(com.facebook.presto.cost.VariableStatsEstimate) Test(org.testng.annotations.Test)

Aggregations

PlanNodeStatsEstimate (com.facebook.presto.cost.PlanNodeStatsEstimate)11 ImmutableMap (com.google.common.collect.ImmutableMap)6 Optional (java.util.Optional)6 Test (org.testng.annotations.Test)6 JOIN_DISTRIBUTION_TYPE (com.facebook.presto.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE)5 JOIN_MAX_BROADCAST_TABLE_SIZE (com.facebook.presto.SystemSessionProperties.JOIN_MAX_BROADCAST_TABLE_SIZE)5 BIGINT (com.facebook.presto.common.type.BigintType.BIGINT)5 CostComparator (com.facebook.presto.cost.CostComparator)5 VariableStatsEstimate (com.facebook.presto.cost.VariableStatsEstimate)5 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)5 VariableReferenceExpression (com.facebook.presto.spi.relation.VariableReferenceExpression)5 JoinDistributionType (com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType)5 PlanMatchPattern.values (com.facebook.presto.sql.planner.assertions.PlanMatchPattern.values)5 RuleAssert (com.facebook.presto.sql.planner.iterative.rule.test.RuleAssert)5 RuleTester (com.facebook.presto.sql.planner.iterative.rule.test.RuleTester)5 ImmutableList (com.google.common.collect.ImmutableList)5 AfterClass (org.testng.annotations.AfterClass)5 BeforeClass (org.testng.annotations.BeforeClass)5 PlanMatchPattern.equiJoinClause (com.facebook.presto.sql.planner.assertions.PlanMatchPattern.equiJoinClause)4 PlanMatchPattern.join (com.facebook.presto.sql.planner.assertions.PlanMatchPattern.join)4