Search in sources :

Example 11 with TableScanNode

use of com.facebook.presto.spi.plan.TableScanNode in project presto by prestodb.

the class TestEffectivePredicateExtractor method testLeftJoin.

@Test
public void testLeftJoin() {
    ImmutableList.Builder<JoinNode.EquiJoinClause> criteriaBuilder = ImmutableList.builder();
    criteriaBuilder.add(new JoinNode.EquiJoinClause(AV, DV));
    criteriaBuilder.add(new JoinNode.EquiJoinClause(BV, EV));
    List<JoinNode.EquiJoinClause> criteria = criteriaBuilder.build();
    Map<VariableReferenceExpression, ColumnHandle> leftAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(AV, BV, CV)));
    TableScanNode leftScan = tableScanNode(leftAssignments);
    Map<VariableReferenceExpression, ColumnHandle> rightAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(DV, EV, FV)));
    TableScanNode rightScan = tableScanNode(rightAssignments);
    FilterNode left = filter(leftScan, and(lessThan(BV, AV), lessThan(CV, bigintLiteral(10)), equals(GV, bigintLiteral(10))));
    FilterNode right = filter(rightScan, and(equals(DV, EV), lessThan(FV, bigintLiteral(100))));
    PlanNode node = new JoinNode(Optional.empty(), newId(), JoinNode.Type.LEFT, left, right, criteria, ImmutableList.<VariableReferenceExpression>builder().addAll(left.getOutputVariables()).addAll(right.getOutputVariables()).build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), ImmutableMap.of());
    RowExpression effectivePredicate = effectivePredicateExtractor.extract(node);
    // All right side symbols having output symbols should be checked against NULL
    assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(lessThan(BV, AV), lessThan(CV, bigintLiteral(10)), or(equals(DV, EV), and(isNull(DV), isNull(EV))), or(lessThan(FV, bigintLiteral(100)), isNull(FV)), or(equals(AV, DV), isNull(DV)), or(equals(BV, EV), isNull(EV))));
}
Also used : ColumnHandle(com.facebook.presto.spi.ColumnHandle) ImmutableList(com.google.common.collect.ImmutableList) JoinNode(com.facebook.presto.sql.planner.plan.JoinNode) SemiJoinNode(com.facebook.presto.sql.planner.plan.SemiJoinNode) FilterNode(com.facebook.presto.spi.plan.FilterNode) RowExpression(com.facebook.presto.spi.relation.RowExpression) PlanNode(com.facebook.presto.spi.plan.PlanNode) TableScanNode(com.facebook.presto.spi.plan.TableScanNode) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) Test(org.testng.annotations.Test)

Example 12 with TableScanNode

use of com.facebook.presto.spi.plan.TableScanNode in project presto by prestodb.

the class TestEffectivePredicateExtractor method testInnerJoin.

@Test
public void testInnerJoin() {
    ImmutableList.Builder<JoinNode.EquiJoinClause> criteriaBuilder = ImmutableList.builder();
    criteriaBuilder.add(new JoinNode.EquiJoinClause(AV, DV));
    criteriaBuilder.add(new JoinNode.EquiJoinClause(BV, EV));
    List<JoinNode.EquiJoinClause> criteria = criteriaBuilder.build();
    Map<VariableReferenceExpression, ColumnHandle> leftAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(AV, BV, CV)));
    TableScanNode leftScan = tableScanNode(leftAssignments);
    Map<VariableReferenceExpression, ColumnHandle> rightAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(DV, EV, FV)));
    TableScanNode rightScan = tableScanNode(rightAssignments);
    FilterNode left = filter(leftScan, and(lessThan(BV, AV), lessThan(CV, bigintLiteral(10)), equals(GV, bigintLiteral(10))));
    FilterNode right = filter(rightScan, and(equals(DV, EV), lessThan(FV, bigintLiteral(100))));
    PlanNode node = new JoinNode(Optional.empty(), newId(), JoinNode.Type.INNER, left, right, criteria, ImmutableList.<VariableReferenceExpression>builder().addAll(left.getOutputVariables()).addAll(right.getOutputVariables()).build(), Optional.of(lessThanOrEqual(BV, EV)), Optional.empty(), Optional.empty(), Optional.empty(), ImmutableMap.of());
    RowExpression effectivePredicate = effectivePredicateExtractor.extract(node);
    // All predicates having output symbol should be carried through
    assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(lessThan(BV, AV), lessThan(CV, bigintLiteral(10)), equals(DV, EV), lessThan(FV, bigintLiteral(100)), equals(AV, DV), equals(BV, EV), lessThanOrEqual(BV, EV)));
}
Also used : ColumnHandle(com.facebook.presto.spi.ColumnHandle) ImmutableList(com.google.common.collect.ImmutableList) JoinNode(com.facebook.presto.sql.planner.plan.JoinNode) SemiJoinNode(com.facebook.presto.sql.planner.plan.SemiJoinNode) FilterNode(com.facebook.presto.spi.plan.FilterNode) RowExpression(com.facebook.presto.spi.relation.RowExpression) PlanNode(com.facebook.presto.spi.plan.PlanNode) TableScanNode(com.facebook.presto.spi.plan.TableScanNode) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) Test(org.testng.annotations.Test)

Example 13 with TableScanNode

use of com.facebook.presto.spi.plan.TableScanNode in project presto by prestodb.

the class TestSchedulingOrderVisitor method testIndexJoinOrder.

@Test
public void testIndexJoinOrder() {
    PlanBuilder planBuilder = new PlanBuilder(TEST_SESSION, new PlanNodeIdAllocator(), METADATA);
    TableScanNode a = planBuilder.tableScan(emptyList(), emptyMap());
    TableScanNode b = planBuilder.tableScan(emptyList(), emptyMap());
    List<PlanNodeId> order = scheduleOrder(planBuilder.indexJoin(IndexJoinNode.Type.INNER, a, b));
    assertEquals(order, ImmutableList.of(b.getId(), a.getId()));
}
Also used : PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) TableScanNode(com.facebook.presto.spi.plan.TableScanNode) PlanNodeIdAllocator(com.facebook.presto.spi.plan.PlanNodeIdAllocator) PlanBuilder(com.facebook.presto.sql.planner.iterative.rule.test.PlanBuilder) Test(org.testng.annotations.Test)

Example 14 with TableScanNode

use of com.facebook.presto.spi.plan.TableScanNode in project presto by prestodb.

the class TestHiveLogicalPlanner method assertRequestedColumnsInLayout.

private void assertRequestedColumnsInLayout(Plan plan, String tableName, Set<String> expectedRequestedColumns) {
    TableScanNode tableScan = searchFrom(plan.getRoot()).where(node -> isTableScanNode(node, tableName)).findOnlyElement();
    assertTrue(tableScan.getTable().getLayout().isPresent());
    HiveTableLayoutHandle layoutHandle = (HiveTableLayoutHandle) tableScan.getTable().getLayout().get();
    assertTrue(layoutHandle.getRequestedColumns().isPresent());
    Set<HiveColumnHandle> requestedColumns = layoutHandle.getRequestedColumns().get();
    List<String> actualRequestedColumns = new ArrayList<>();
    for (HiveColumnHandle column : requestedColumns) {
        if (!column.getRequiredSubfields().isEmpty()) {
            column.getRequiredSubfields().stream().map(Subfield::serialize).forEach(actualRequestedColumns::add);
        } else {
            actualRequestedColumns.add(column.getName());
        }
    }
    Set<String> requestedColumnsSet = ImmutableSet.copyOf(actualRequestedColumns);
    assertEquals(requestedColumnsSet.size(), actualRequestedColumns.size(), "There should be no duplicates in the requested column list");
    assertEquals(requestedColumnsSet, expectedRequestedColumns);
}
Also used : TestingAccessControlManager.privilege(com.facebook.presto.testing.TestingAccessControlManager.privilege) Arrays(java.util.Arrays) SELECT_COLUMN(com.facebook.presto.testing.TestingAccessControlManager.TestingPrivilegeType.SELECT_COLUMN) PlanMatchPattern.filter(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.filter) PartitionWithStatistics(com.facebook.presto.hive.metastore.PartitionWithStatistics) PlanMatchPattern.anyTree(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.anyTree) MetastoreContext(com.facebook.presto.hive.metastore.MetastoreContext) MatchResult(com.facebook.presto.sql.planner.assertions.MatchResult) QueryRunner(com.facebook.presto.testing.QueryRunner) Test(org.testng.annotations.Test) PlanMatchPattern(com.facebook.presto.sql.planner.assertions.PlanMatchPattern) PlanMatchPattern.join(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.join) TupleDomain.withColumnDomains(com.facebook.presto.common.predicate.TupleDomain.withColumnDomains) OPTIMIZE_METADATA_QUERIES_IGNORE_STATS(com.facebook.presto.SystemSessionProperties.OPTIMIZE_METADATA_QUERIES_IGNORE_STATS) ExtendedHiveMetastore(com.facebook.presto.hive.metastore.ExtendedHiveMetastore) Slices(io.airlift.slice.Slices) Map(java.util.Map) PlanMatchPattern.expression(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.expression) Slices.utf8Slice(io.airlift.slice.Slices.utf8Slice) CUSTOMER(io.airlift.tpch.TpchTable.CUSTOMER) Assert.assertFalse(org.testng.Assert.assertFalse) PrincipalPrivileges(com.facebook.presto.hive.metastore.PrincipalPrivileges) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) SHUFFLE_PARTITIONED_COLUMNS_FOR_TABLE_WRITE(com.facebook.presto.hive.HiveSessionProperties.SHUFFLE_PARTITIONED_COLUMNS_FOR_TABLE_WRITE) Set(java.util.Set) PlanMatchPattern.anySymbol(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.anySymbol) JOIN_DISTRIBUTION_TYPE(com.facebook.presto.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE) MATERIALIZED_VIEW_MISSING_PARTITIONS_THRESHOLD(com.facebook.presto.hive.HiveSessionProperties.MATERIALIZED_VIEW_MISSING_PARTITIONS_THRESHOLD) PlanMatchPattern.unnest(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.unnest) Collectors.joining(java.util.stream.Collectors.joining) FeaturesConfig(com.facebook.presto.sql.analyzer.FeaturesConfig) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) FileHiveMetastore(com.facebook.presto.hive.metastore.file.FileHiveMetastore) LongLiteral(com.facebook.presto.sql.tree.LongLiteral) PARTIAL_AGGREGATION_PUSHDOWN_ENABLED(com.facebook.presto.hive.HiveSessionProperties.PARTIAL_AGGREGATION_PUSHDOWN_ENABLED) PlanMatchPattern.node(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.node) MoreObjects.toStringHelper(com.google.common.base.MoreObjects.toStringHelper) Domain.notNull(com.facebook.presto.common.predicate.Domain.notNull) Table(com.facebook.presto.hive.metastore.Table) Slice(io.airlift.slice.Slice) GATHER(com.facebook.presto.sql.planner.plan.ExchangeNode.Type.GATHER) ConstantExpression(com.facebook.presto.spi.relation.ConstantExpression) TypeSignatureProvider.fromTypes(com.facebook.presto.sql.analyzer.TypeSignatureProvider.fromTypes) ArrayList(java.util.ArrayList) ParquetTypeUtils.pushdownColumnNameForSubfield(com.facebook.presto.parquet.ParquetTypeUtils.pushdownColumnNameForSubfield) Identity(com.facebook.presto.spi.security.Identity) BOOLEAN(com.facebook.presto.common.type.BooleanType.BOOLEAN) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) ArrayType(com.facebook.presto.common.type.ArrayType) FunctionResolution(com.facebook.presto.sql.relational.FunctionResolution) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) OPTIMIZE_METADATA_QUERIES(com.facebook.presto.SystemSessionProperties.OPTIMIZE_METADATA_QUERIES) Functions(com.google.common.base.Functions) BIGINT(com.facebook.presto.common.type.BigintType.BIGINT) SymbolAliases(com.facebook.presto.sql.planner.assertions.SymbolAliases) AbstractTestQueryFramework(com.facebook.presto.tests.AbstractTestQueryFramework) HIVE_CATALOG(com.facebook.presto.hive.HiveQueryRunner.HIVE_CATALOG) Session(com.facebook.presto.Session) ELIMINATE_CROSS_JOINS(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinReorderingStrategy.ELIMINATE_CROSS_JOINS) StatsProvider(com.facebook.presto.cost.StatsProvider) PlanMatchPattern.exchange(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.exchange) Domain(com.facebook.presto.common.predicate.Domain) COLLECT_COLUMN_STATISTICS_ON_WRITE(com.facebook.presto.hive.HiveSessionProperties.COLLECT_COLUMN_STATISTICS_ON_WRITE) ColumnHandle(com.facebook.presto.spi.ColumnHandle) PUSHDOWN_FILTER_ENABLED(com.facebook.presto.hive.HiveSessionProperties.PUSHDOWN_FILTER_ENABLED) TableScanNode(com.facebook.presto.spi.plan.TableScanNode) SemiJoinNode(com.facebook.presto.sql.planner.plan.SemiJoinNode) PartitionStatistics(com.facebook.presto.hive.metastore.PartitionStatistics) MatchResult.match(com.facebook.presto.sql.planner.assertions.MatchResult.match) ValueSet(com.facebook.presto.common.predicate.ValueSet) Metadata(com.facebook.presto.metadata.Metadata) FunctionAndTypeManager(com.facebook.presto.metadata.FunctionAndTypeManager) AggregationNode(com.facebook.presto.spi.plan.AggregationNode) HiveColumnHandle.isPushedDownSubfield(com.facebook.presto.hive.HiveColumnHandle.isPushedDownSubfield) PlanMatchPattern.output(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.output) QUERY_OPTIMIZATION_WITH_MATERIALIZED_VIEW_ENABLED(com.facebook.presto.SystemSessionProperties.QUERY_OPTIMIZATION_WITH_MATERIALIZED_VIEW_ENABLED) LINE_ITEM(io.airlift.tpch.TpchTable.LINE_ITEM) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) ValueSet.ofRanges(com.facebook.presto.common.predicate.ValueSet.ofRanges) EQUAL(com.facebook.presto.common.function.OperatorType.EQUAL) PUSHDOWN_DEREFERENCE_ENABLED(com.facebook.presto.SystemSessionProperties.PUSHDOWN_DEREFERENCE_ENABLED) Path(org.apache.hadoop.fs.Path) CallExpression(com.facebook.presto.spi.relation.CallExpression) URI(java.net.URI) PlanMatchPattern.aggregation(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.aggregation) FunctionCall(com.facebook.presto.sql.tree.FunctionCall) PlanMatchPattern.globalAggregation(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.globalAggregation) ImmutableSet(com.google.common.collect.ImmutableSet) PlanMatchPattern.project(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.project) ImmutableMap(com.google.common.collect.ImmutableMap) DOUBLE(com.facebook.presto.common.type.DoubleType.DOUBLE) Domain.singleValue(com.facebook.presto.common.predicate.Domain.singleValue) VarcharType(com.facebook.presto.common.type.VarcharType) Collectors(java.util.stream.Collectors) TRUE_CONSTANT(com.facebook.presto.expressions.LogicalRowExpressions.TRUE_CONSTANT) PARQUET_DEREFERENCE_PUSHDOWN_ENABLED(com.facebook.presto.hive.HiveSessionProperties.PARQUET_DEREFERENCE_PUSHDOWN_ENABLED) String.format(java.lang.String.format) Range(com.facebook.presto.common.predicate.Range) REMOTE_STREAMING(com.facebook.presto.sql.planner.plan.ExchangeNode.Scope.REMOTE_STREAMING) Objects(java.util.Objects) List(java.util.List) Range.greaterThan(com.facebook.presto.common.predicate.Range.greaterThan) JOIN_REORDERING_STRATEGY(com.facebook.presto.SystemSessionProperties.JOIN_REORDERING_STRATEGY) Domain.create(com.facebook.presto.common.predicate.Domain.create) RANGE_FILTERS_ON_SUBSCRIPTS_ENABLED(com.facebook.presto.hive.HiveSessionProperties.RANGE_FILTERS_ON_SUBSCRIPTS_ENABLED) MetastoreUtil.toPartitionValues(com.facebook.presto.hive.metastore.MetastoreUtil.toPartitionValues) Optional(java.util.Optional) NO_MATCH(com.facebook.presto.sql.planner.assertions.MatchResult.NO_MATCH) ExpectedValueProvider(com.facebook.presto.sql.planner.assertions.ExpectedValueProvider) OPTIMIZE_METADATA_QUERIES_CALL_THRESHOLD(com.facebook.presto.SystemSessionProperties.OPTIMIZE_METADATA_QUERIES_CALL_THRESHOLD) NoHdfsAuthentication(com.facebook.presto.hive.authentication.NoHdfsAuthentication) INNER(com.facebook.presto.sql.planner.plan.JoinNode.Type.INNER) NATION(io.airlift.tpch.TpchTable.NATION) PARTIAL_AGGREGATION_PUSHDOWN_FOR_VARIABLE_LENGTH_DATATYPES_ENABLED(com.facebook.presto.hive.HiveSessionProperties.PARTIAL_AGGREGATION_PUSHDOWN_FOR_VARIABLE_LENGTH_DATATYPES_ENABLED) Assert.assertEquals(com.facebook.presto.testing.assertions.Assert.assertEquals) ORDERS(io.airlift.tpch.TpchTable.ORDERS) VARCHAR(com.facebook.presto.common.type.VarcharType.VARCHAR) ConnectorTableLayoutHandle(com.facebook.presto.spi.ConnectorTableLayoutHandle) VarcharType.createVarcharType(com.facebook.presto.common.type.VarcharType.createVarcharType) Partition(com.facebook.presto.hive.metastore.Partition) StringLiteral(com.facebook.presto.sql.tree.StringLiteral) Subfield(com.facebook.presto.common.Subfield) ImmutableList(com.google.common.collect.ImmutableList) LOCAL(com.facebook.presto.sql.planner.plan.ExchangeNode.Scope.LOCAL) PlanMatchPattern.equiJoinClause(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.equiJoinClause) Objects.requireNonNull(java.util.Objects.requireNonNull) PlanMatchPattern.any(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.any) PlanMatchPattern.strictTableScan(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.strictTableScan) Plan(com.facebook.presto.sql.planner.Plan) Domain.multipleValues(com.facebook.presto.common.predicate.Domain.multipleValues) PlanNodeSearcher.searchFrom(com.facebook.presto.sql.planner.optimizations.PlanNodeSearcher.searchFrom) RowExpression(com.facebook.presto.spi.relation.RowExpression) JoinNode(com.facebook.presto.sql.planner.plan.JoinNode) INSERT_TABLE(com.facebook.presto.testing.TestingAccessControlManager.TestingPrivilegeType.INSERT_TABLE) Matcher(com.facebook.presto.sql.planner.assertions.Matcher) TupleDomain(com.facebook.presto.common.predicate.TupleDomain) Consumer(java.util.function.Consumer) PlanNode(com.facebook.presto.spi.plan.PlanNode) MaterializedResult(com.facebook.presto.testing.MaterializedResult) LEFT(com.facebook.presto.sql.planner.plan.JoinNode.Type.LEFT) StorageFormat.fromHiveStorageFormat(com.facebook.presto.hive.metastore.StorageFormat.fromHiveStorageFormat) SYNTHESIZED(com.facebook.presto.hive.HiveColumnHandle.ColumnType.SYNTHESIZED) Assert.assertTrue(org.testng.Assert.assertTrue) REFERENCED_MATERIALIZED_VIEWS(com.facebook.presto.hive.HiveMetadata.REFERENCED_MATERIALIZED_VIEWS) PlanMatchPattern.values(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.values) TestHiveIntegrationSmokeTest.assertRemoteExchangesCount(com.facebook.presto.hive.TestHiveIntegrationSmokeTest.assertRemoteExchangesCount) TableScanNode(com.facebook.presto.spi.plan.TableScanNode) ArrayList(java.util.ArrayList)

Example 15 with TableScanNode

use of com.facebook.presto.spi.plan.TableScanNode in project presto by prestodb.

the class TestHiveLogicalPlanner method assertBucketFilter.

private void assertBucketFilter(Plan plan, String tableName, int readBucketCount, Set<Integer> bucketsToKeep) {
    TableScanNode tableScan = searchFrom(plan.getRoot()).where(node -> isTableScanNode(node, tableName)).findOnlyElement();
    assertTrue(tableScan.getTable().getLayout().isPresent());
    HiveTableLayoutHandle layoutHandle = (HiveTableLayoutHandle) tableScan.getTable().getLayout().get();
    assertTrue(layoutHandle.getBucketHandle().isPresent());
    assertTrue(layoutHandle.getBucketFilter().isPresent());
    assertEquals(layoutHandle.getBucketHandle().get().getReadBucketCount(), readBucketCount);
    assertEquals(layoutHandle.getBucketFilter().get().getBucketsToKeep(), bucketsToKeep);
}
Also used : TestingAccessControlManager.privilege(com.facebook.presto.testing.TestingAccessControlManager.privilege) Arrays(java.util.Arrays) SELECT_COLUMN(com.facebook.presto.testing.TestingAccessControlManager.TestingPrivilegeType.SELECT_COLUMN) PlanMatchPattern.filter(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.filter) PartitionWithStatistics(com.facebook.presto.hive.metastore.PartitionWithStatistics) PlanMatchPattern.anyTree(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.anyTree) MetastoreContext(com.facebook.presto.hive.metastore.MetastoreContext) MatchResult(com.facebook.presto.sql.planner.assertions.MatchResult) QueryRunner(com.facebook.presto.testing.QueryRunner) Test(org.testng.annotations.Test) PlanMatchPattern(com.facebook.presto.sql.planner.assertions.PlanMatchPattern) PlanMatchPattern.join(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.join) TupleDomain.withColumnDomains(com.facebook.presto.common.predicate.TupleDomain.withColumnDomains) OPTIMIZE_METADATA_QUERIES_IGNORE_STATS(com.facebook.presto.SystemSessionProperties.OPTIMIZE_METADATA_QUERIES_IGNORE_STATS) ExtendedHiveMetastore(com.facebook.presto.hive.metastore.ExtendedHiveMetastore) Slices(io.airlift.slice.Slices) Map(java.util.Map) PlanMatchPattern.expression(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.expression) Slices.utf8Slice(io.airlift.slice.Slices.utf8Slice) CUSTOMER(io.airlift.tpch.TpchTable.CUSTOMER) Assert.assertFalse(org.testng.Assert.assertFalse) PrincipalPrivileges(com.facebook.presto.hive.metastore.PrincipalPrivileges) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) SHUFFLE_PARTITIONED_COLUMNS_FOR_TABLE_WRITE(com.facebook.presto.hive.HiveSessionProperties.SHUFFLE_PARTITIONED_COLUMNS_FOR_TABLE_WRITE) Set(java.util.Set) PlanMatchPattern.anySymbol(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.anySymbol) JOIN_DISTRIBUTION_TYPE(com.facebook.presto.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE) MATERIALIZED_VIEW_MISSING_PARTITIONS_THRESHOLD(com.facebook.presto.hive.HiveSessionProperties.MATERIALIZED_VIEW_MISSING_PARTITIONS_THRESHOLD) PlanMatchPattern.unnest(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.unnest) Collectors.joining(java.util.stream.Collectors.joining) FeaturesConfig(com.facebook.presto.sql.analyzer.FeaturesConfig) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) FileHiveMetastore(com.facebook.presto.hive.metastore.file.FileHiveMetastore) LongLiteral(com.facebook.presto.sql.tree.LongLiteral) PARTIAL_AGGREGATION_PUSHDOWN_ENABLED(com.facebook.presto.hive.HiveSessionProperties.PARTIAL_AGGREGATION_PUSHDOWN_ENABLED) PlanMatchPattern.node(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.node) MoreObjects.toStringHelper(com.google.common.base.MoreObjects.toStringHelper) Domain.notNull(com.facebook.presto.common.predicate.Domain.notNull) Table(com.facebook.presto.hive.metastore.Table) Slice(io.airlift.slice.Slice) GATHER(com.facebook.presto.sql.planner.plan.ExchangeNode.Type.GATHER) ConstantExpression(com.facebook.presto.spi.relation.ConstantExpression) TypeSignatureProvider.fromTypes(com.facebook.presto.sql.analyzer.TypeSignatureProvider.fromTypes) ArrayList(java.util.ArrayList) ParquetTypeUtils.pushdownColumnNameForSubfield(com.facebook.presto.parquet.ParquetTypeUtils.pushdownColumnNameForSubfield) Identity(com.facebook.presto.spi.security.Identity) BOOLEAN(com.facebook.presto.common.type.BooleanType.BOOLEAN) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) ArrayType(com.facebook.presto.common.type.ArrayType) FunctionResolution(com.facebook.presto.sql.relational.FunctionResolution) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) OPTIMIZE_METADATA_QUERIES(com.facebook.presto.SystemSessionProperties.OPTIMIZE_METADATA_QUERIES) Functions(com.google.common.base.Functions) BIGINT(com.facebook.presto.common.type.BigintType.BIGINT) SymbolAliases(com.facebook.presto.sql.planner.assertions.SymbolAliases) AbstractTestQueryFramework(com.facebook.presto.tests.AbstractTestQueryFramework) HIVE_CATALOG(com.facebook.presto.hive.HiveQueryRunner.HIVE_CATALOG) Session(com.facebook.presto.Session) ELIMINATE_CROSS_JOINS(com.facebook.presto.sql.analyzer.FeaturesConfig.JoinReorderingStrategy.ELIMINATE_CROSS_JOINS) StatsProvider(com.facebook.presto.cost.StatsProvider) PlanMatchPattern.exchange(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.exchange) Domain(com.facebook.presto.common.predicate.Domain) COLLECT_COLUMN_STATISTICS_ON_WRITE(com.facebook.presto.hive.HiveSessionProperties.COLLECT_COLUMN_STATISTICS_ON_WRITE) ColumnHandle(com.facebook.presto.spi.ColumnHandle) PUSHDOWN_FILTER_ENABLED(com.facebook.presto.hive.HiveSessionProperties.PUSHDOWN_FILTER_ENABLED) TableScanNode(com.facebook.presto.spi.plan.TableScanNode) SemiJoinNode(com.facebook.presto.sql.planner.plan.SemiJoinNode) PartitionStatistics(com.facebook.presto.hive.metastore.PartitionStatistics) MatchResult.match(com.facebook.presto.sql.planner.assertions.MatchResult.match) ValueSet(com.facebook.presto.common.predicate.ValueSet) Metadata(com.facebook.presto.metadata.Metadata) FunctionAndTypeManager(com.facebook.presto.metadata.FunctionAndTypeManager) AggregationNode(com.facebook.presto.spi.plan.AggregationNode) HiveColumnHandle.isPushedDownSubfield(com.facebook.presto.hive.HiveColumnHandle.isPushedDownSubfield) PlanMatchPattern.output(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.output) QUERY_OPTIMIZATION_WITH_MATERIALIZED_VIEW_ENABLED(com.facebook.presto.SystemSessionProperties.QUERY_OPTIMIZATION_WITH_MATERIALIZED_VIEW_ENABLED) LINE_ITEM(io.airlift.tpch.TpchTable.LINE_ITEM) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) ValueSet.ofRanges(com.facebook.presto.common.predicate.ValueSet.ofRanges) EQUAL(com.facebook.presto.common.function.OperatorType.EQUAL) PUSHDOWN_DEREFERENCE_ENABLED(com.facebook.presto.SystemSessionProperties.PUSHDOWN_DEREFERENCE_ENABLED) Path(org.apache.hadoop.fs.Path) CallExpression(com.facebook.presto.spi.relation.CallExpression) URI(java.net.URI) PlanMatchPattern.aggregation(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.aggregation) FunctionCall(com.facebook.presto.sql.tree.FunctionCall) PlanMatchPattern.globalAggregation(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.globalAggregation) ImmutableSet(com.google.common.collect.ImmutableSet) PlanMatchPattern.project(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.project) ImmutableMap(com.google.common.collect.ImmutableMap) DOUBLE(com.facebook.presto.common.type.DoubleType.DOUBLE) Domain.singleValue(com.facebook.presto.common.predicate.Domain.singleValue) VarcharType(com.facebook.presto.common.type.VarcharType) Collectors(java.util.stream.Collectors) TRUE_CONSTANT(com.facebook.presto.expressions.LogicalRowExpressions.TRUE_CONSTANT) PARQUET_DEREFERENCE_PUSHDOWN_ENABLED(com.facebook.presto.hive.HiveSessionProperties.PARQUET_DEREFERENCE_PUSHDOWN_ENABLED) String.format(java.lang.String.format) Range(com.facebook.presto.common.predicate.Range) REMOTE_STREAMING(com.facebook.presto.sql.planner.plan.ExchangeNode.Scope.REMOTE_STREAMING) Objects(java.util.Objects) List(java.util.List) Range.greaterThan(com.facebook.presto.common.predicate.Range.greaterThan) JOIN_REORDERING_STRATEGY(com.facebook.presto.SystemSessionProperties.JOIN_REORDERING_STRATEGY) Domain.create(com.facebook.presto.common.predicate.Domain.create) RANGE_FILTERS_ON_SUBSCRIPTS_ENABLED(com.facebook.presto.hive.HiveSessionProperties.RANGE_FILTERS_ON_SUBSCRIPTS_ENABLED) MetastoreUtil.toPartitionValues(com.facebook.presto.hive.metastore.MetastoreUtil.toPartitionValues) Optional(java.util.Optional) NO_MATCH(com.facebook.presto.sql.planner.assertions.MatchResult.NO_MATCH) ExpectedValueProvider(com.facebook.presto.sql.planner.assertions.ExpectedValueProvider) OPTIMIZE_METADATA_QUERIES_CALL_THRESHOLD(com.facebook.presto.SystemSessionProperties.OPTIMIZE_METADATA_QUERIES_CALL_THRESHOLD) NoHdfsAuthentication(com.facebook.presto.hive.authentication.NoHdfsAuthentication) INNER(com.facebook.presto.sql.planner.plan.JoinNode.Type.INNER) NATION(io.airlift.tpch.TpchTable.NATION) PARTIAL_AGGREGATION_PUSHDOWN_FOR_VARIABLE_LENGTH_DATATYPES_ENABLED(com.facebook.presto.hive.HiveSessionProperties.PARTIAL_AGGREGATION_PUSHDOWN_FOR_VARIABLE_LENGTH_DATATYPES_ENABLED) Assert.assertEquals(com.facebook.presto.testing.assertions.Assert.assertEquals) ORDERS(io.airlift.tpch.TpchTable.ORDERS) VARCHAR(com.facebook.presto.common.type.VarcharType.VARCHAR) ConnectorTableLayoutHandle(com.facebook.presto.spi.ConnectorTableLayoutHandle) VarcharType.createVarcharType(com.facebook.presto.common.type.VarcharType.createVarcharType) Partition(com.facebook.presto.hive.metastore.Partition) StringLiteral(com.facebook.presto.sql.tree.StringLiteral) Subfield(com.facebook.presto.common.Subfield) ImmutableList(com.google.common.collect.ImmutableList) LOCAL(com.facebook.presto.sql.planner.plan.ExchangeNode.Scope.LOCAL) PlanMatchPattern.equiJoinClause(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.equiJoinClause) Objects.requireNonNull(java.util.Objects.requireNonNull) PlanMatchPattern.any(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.any) PlanMatchPattern.strictTableScan(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.strictTableScan) Plan(com.facebook.presto.sql.planner.Plan) Domain.multipleValues(com.facebook.presto.common.predicate.Domain.multipleValues) PlanNodeSearcher.searchFrom(com.facebook.presto.sql.planner.optimizations.PlanNodeSearcher.searchFrom) RowExpression(com.facebook.presto.spi.relation.RowExpression) JoinNode(com.facebook.presto.sql.planner.plan.JoinNode) INSERT_TABLE(com.facebook.presto.testing.TestingAccessControlManager.TestingPrivilegeType.INSERT_TABLE) Matcher(com.facebook.presto.sql.planner.assertions.Matcher) TupleDomain(com.facebook.presto.common.predicate.TupleDomain) Consumer(java.util.function.Consumer) PlanNode(com.facebook.presto.spi.plan.PlanNode) MaterializedResult(com.facebook.presto.testing.MaterializedResult) LEFT(com.facebook.presto.sql.planner.plan.JoinNode.Type.LEFT) StorageFormat.fromHiveStorageFormat(com.facebook.presto.hive.metastore.StorageFormat.fromHiveStorageFormat) SYNTHESIZED(com.facebook.presto.hive.HiveColumnHandle.ColumnType.SYNTHESIZED) Assert.assertTrue(org.testng.Assert.assertTrue) REFERENCED_MATERIALIZED_VIEWS(com.facebook.presto.hive.HiveMetadata.REFERENCED_MATERIALIZED_VIEWS) PlanMatchPattern.values(com.facebook.presto.sql.planner.assertions.PlanMatchPattern.values) TestHiveIntegrationSmokeTest.assertRemoteExchangesCount(com.facebook.presto.hive.TestHiveIntegrationSmokeTest.assertRemoteExchangesCount) TableScanNode(com.facebook.presto.spi.plan.TableScanNode)

Aggregations

TableScanNode (com.facebook.presto.spi.plan.TableScanNode)60 Test (org.testng.annotations.Test)37 VariableReferenceExpression (com.facebook.presto.spi.relation.VariableReferenceExpression)35 PlanNode (com.facebook.presto.spi.plan.PlanNode)29 ColumnHandle (com.facebook.presto.spi.ColumnHandle)25 JoinNode (com.facebook.presto.sql.planner.plan.JoinNode)21 ImmutableList (com.google.common.collect.ImmutableList)18 TableHandle (com.facebook.presto.spi.TableHandle)16 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)16 RowExpression (com.facebook.presto.spi.relation.RowExpression)15 ImmutableMap (com.google.common.collect.ImmutableMap)15 PlanBuilder (com.facebook.presto.sql.planner.iterative.rule.test.PlanBuilder)14 Optional (java.util.Optional)13 Type (com.facebook.presto.common.type.Type)12 AggregationNode (com.facebook.presto.spi.plan.AggregationNode)12 SemiJoinNode (com.facebook.presto.sql.planner.plan.SemiJoinNode)12 FilterNode (com.facebook.presto.spi.plan.FilterNode)11 TupleDomain (com.facebook.presto.common.predicate.TupleDomain)10 Metadata (com.facebook.presto.metadata.Metadata)10 ImmutableSet (com.google.common.collect.ImmutableSet)10