Search in sources :

Example 16 with AggregationNode

use of io.prestosql.spi.plan.AggregationNode in project hetu-core by openlookeng.

the class RewriteSpatialPartitioningAggregation method apply.

@Override
public Result apply(AggregationNode node, Captures captures, Context context) {
    ImmutableMap.Builder<Symbol, Aggregation> aggregations = ImmutableMap.builder();
    Symbol partitionCountSymbol = context.getSymbolAllocator().newSymbol("partition_count", INTEGER);
    ImmutableMap.Builder<Symbol, RowExpression> envelopeAssignments = ImmutableMap.builder();
    for (Map.Entry<Symbol, Aggregation> entry : node.getAggregations().entrySet()) {
        Aggregation aggregation = entry.getValue();
        QualifiedObjectName name = metadata.getFunctionAndTypeManager().getFunctionMetadata(aggregation.getFunctionHandle()).getName();
        Type geometryType = metadata.getType(GEOMETRY_TYPE_SIGNATURE);
        if (name.equals(NAME) && aggregation.getArguments().size() == 1) {
            RowExpression geometry = getOnlyElement(aggregation.getArguments().stream().collect(toImmutableList()));
            Symbol envelopeSymbol = context.getSymbolAllocator().newSymbol("envelope", metadata.getType(GEOMETRY_TYPE_SIGNATURE));
            if (isFunctionNameMatch(geometry, "ST_Envelope")) {
                envelopeAssignments.put(envelopeSymbol, geometry);
            } else {
                envelopeAssignments.put(envelopeSymbol, castToRowExpression(new FunctionCallBuilder(metadata).setName(QualifiedName.of("ST_Envelope")).addArgument(GEOMETRY_TYPE_SIGNATURE, castToExpression(geometry)).build()));
            }
            aggregations.put(entry.getKey(), new Aggregation(new CallExpression(name.getObjectName(), metadata.getFunctionAndTypeManager().lookupFunction(NAME.getObjectName(), fromTypes(geometryType, INTEGER)), context.getSymbolAllocator().getTypes().get(entry.getKey()), ImmutableList.of(castToRowExpression(toSymbolReference(envelopeSymbol)), castToRowExpression(toSymbolReference(partitionCountSymbol))), Optional.empty()), ImmutableList.of(castToRowExpression(toSymbolReference(envelopeSymbol)), castToRowExpression(toSymbolReference(partitionCountSymbol))), false, Optional.empty(), Optional.empty(), aggregation.getMask()));
        } else {
            aggregations.put(entry);
        }
    }
    return Result.ofPlanNode(new AggregationNode(node.getId(), new ProjectNode(context.getIdAllocator().getNextId(), node.getSource(), Assignments.builder().putAll(AssignmentUtils.identityAsSymbolReferences(node.getSource().getOutputSymbols())).put(partitionCountSymbol, castToRowExpression(new LongLiteral(Integer.toString(getHashPartitionCount(context.getSession()))))).putAll(envelopeAssignments.build()).build()), aggregations.build(), node.getGroupingSets(), node.getPreGroupedSymbols(), node.getStep(), node.getHashSymbol(), node.getGroupIdSymbol(), node.getAggregationType(), node.getFinalizeSymbol()));
}
Also used : LongLiteral(io.prestosql.sql.tree.LongLiteral) Symbol(io.prestosql.spi.plan.Symbol) OriginalExpressionUtils.castToRowExpression(io.prestosql.sql.relational.OriginalExpressionUtils.castToRowExpression) RowExpression(io.prestosql.spi.relation.RowExpression) AggregationNode(io.prestosql.spi.plan.AggregationNode) ImmutableMap(com.google.common.collect.ImmutableMap) QualifiedObjectName(io.prestosql.spi.connector.QualifiedObjectName) Aggregation(io.prestosql.spi.plan.AggregationNode.Aggregation) Type(io.prestosql.spi.type.Type) ProjectNode(io.prestosql.spi.plan.ProjectNode) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) CallExpression(io.prestosql.spi.relation.CallExpression) FunctionCallBuilder(io.prestosql.sql.planner.FunctionCallBuilder)

Example 17 with AggregationNode

use of io.prestosql.spi.plan.AggregationNode in project hetu-core by openlookeng.

the class StarTreeAggregationRule method optimize.

public Result optimize(AggregationNode aggregationNode, final PlanNode filterNode, TableScanNode tableScanNode, Map<String, Object> symbolMapping, Session session, PlanSymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator, WarningCollector warningCollector) {
    TableHandle tableHandle = tableScanNode.getTable();
    TableMetadata tableMetadata = metadata.getTableMetadata(session, tableHandle);
    String tableName = tableMetadata.getQualifiedName().toString();
    CubeStatement statement = CubeStatementGenerator.generate(tableName, aggregationNode, symbolMapping);
    // Don't use star-tree for non-aggregate queries
    if (statement.getAggregations().isEmpty()) {
        return Result.empty();
    }
    boolean hasDistinct = statement.getAggregations().stream().anyMatch(AggregationSignature::isDistinct);
    // Since cube is pre-aggregated, utilising it for such queries could return incorrect result
    if (aggregationNode.hasEmptyGroupingSet() && hasDistinct) {
        return Result.empty();
    }
    List<CubeMetadata> cubeMetadataList = CubeMetadata.filter(this.cubeMetaStore.getMetadataList(statement.getFrom()), statement);
    // Compare FilterNode predicate with Cube predicates to evaluate which cube can be used.
    List<CubeMetadata> matchedCubeMetadataList = cubeMetadataList.stream().filter(cubeMetadata -> filterPredicateMatches((FilterNode) filterNode, cubeMetadata, session, symbolAllocator.getTypes())).collect(Collectors.toList());
    // Match based on filter conditions
    if (matchedCubeMetadataList.isEmpty()) {
        return Result.empty();
    }
    LongSupplier lastModifiedTimeSupplier = metadata.getTableLastModifiedTimeSupplier(session, tableHandle);
    if (lastModifiedTimeSupplier == null) {
        warningCollector.add(new PrestoWarning(EXPIRED_CUBE, "Unable to identify last modified time of " + tableName + ". Ignoring star tree cubes."));
        return Result.empty();
    }
    // Filter out cubes that were created before the source table was updated
    long lastModifiedTime = lastModifiedTimeSupplier.getAsLong();
    // There was a problem retrieving last modified time, we should skip using star tree rather than failing the query
    if (lastModifiedTime == -1L) {
        return Result.empty();
    }
    matchedCubeMetadataList = matchedCubeMetadataList.stream().filter(cubeMetadata -> cubeMetadata.getSourceTableLastUpdatedTime() >= lastModifiedTime).collect(Collectors.toList());
    if (matchedCubeMetadataList.isEmpty()) {
        warningCollector.add(new PrestoWarning(EXPIRED_CUBE, tableName + " has been modified after creating cubes. Ignoring expired cubes."));
        return Result.empty();
    }
    // If multiple cubes are matching then lets select the recent built cube
    // so sort the cube based on the last updated time stamp
    matchedCubeMetadataList.sort(Comparator.comparingLong(CubeMetadata::getLastUpdatedTime).reversed());
    CubeMetadata matchedCubeMetadata = matchedCubeMetadataList.get(0);
    AggregationRewriteWithCube aggregationRewriteWithCube = new AggregationRewriteWithCube(metadata, session, symbolAllocator, idAllocator, symbolMapping, matchedCubeMetadata);
    return Result.ofPlanNode(aggregationRewriteWithCube.rewrite(aggregationNode, rewriteByRemovingSourceFilter(filterNode, matchedCubeMetadata)));
}
Also used : TableMetadata(io.prestosql.metadata.TableMetadata) LongSupplier(java.util.function.LongSupplier) PrestoWarning(io.prestosql.spi.PrestoWarning) Patterns.aggregation(io.prestosql.sql.planner.plan.Patterns.aggregation) SystemSessionProperties(io.prestosql.SystemSessionProperties) TypeProvider(io.prestosql.sql.planner.TypeProvider) SqlParser(io.prestosql.sql.parser.SqlParser) AggregationNode(io.prestosql.spi.plan.AggregationNode) WarningCollector(io.prestosql.execution.warnings.WarningCollector) Capture.newCapture(io.prestosql.matching.Capture.newCapture) FilterNode(io.prestosql.spi.plan.FilterNode) Pair(org.apache.commons.lang3.tuple.Pair) Map(java.util.Map) OriginalExpressionUtils.castToRowExpression(io.prestosql.sql.relational.OriginalExpressionUtils.castToRowExpression) OriginalExpressionUtils.castToExpression(io.prestosql.sql.relational.OriginalExpressionUtils.castToExpression) CubeFilter(io.hetu.core.spi.cube.CubeFilter) Identifier(io.prestosql.sql.tree.Identifier) CubeMetaStore(io.hetu.core.spi.cube.io.CubeMetaStore) SymbolsExtractor(io.prestosql.sql.planner.SymbolsExtractor) TableScanNode(io.prestosql.spi.plan.TableScanNode) Set(java.util.Set) PlanNode(io.prestosql.spi.plan.PlanNode) CubeStatement(io.hetu.core.spi.cube.CubeStatement) ProjectNode(io.prestosql.spi.plan.ProjectNode) Collectors(java.util.stream.Collectors) Metadata(io.prestosql.metadata.Metadata) PlanSymbolAllocator(io.prestosql.sql.planner.PlanSymbolAllocator) Captures(io.prestosql.matching.Captures) List(java.util.List) ExpressionUtils(io.prestosql.sql.ExpressionUtils) Capture(io.prestosql.matching.Capture) AggregationSignature(io.hetu.core.spi.cube.aggregator.AggregationSignature) Optional(java.util.Optional) STAR_TREE(io.prestosql.cube.CubeManager.STAR_TREE) Patterns.optionalSource(io.prestosql.sql.planner.plan.Patterns.optionalSource) Patterns.source(io.prestosql.sql.planner.plan.Patterns.source) TableMetadata(io.prestosql.metadata.TableMetadata) Logger(io.airlift.log.Logger) Pattern(io.prestosql.matching.Pattern) TableHandle(io.prestosql.spi.metadata.TableHandle) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ExpressionDomainTranslator(io.prestosql.sql.planner.ExpressionDomainTranslator) BooleanLiteral(io.prestosql.sql.tree.BooleanLiteral) Objects.requireNonNull(java.util.Objects.requireNonNull) Session(io.prestosql.Session) LinkedList(java.util.LinkedList) ParsingOptions(io.prestosql.sql.parser.ParsingOptions) Symbol(io.prestosql.spi.plan.Symbol) EXPIRED_CUBE(io.prestosql.spi.connector.StandardWarningCode.EXPIRED_CUBE) Rule(io.prestosql.sql.planner.iterative.Rule) TupleDomain(io.prestosql.spi.predicate.TupleDomain) CubeStatementGenerator(io.prestosql.cube.CubeStatementGenerator) SystemSessionProperties.isEnableStarTreeIndex(io.prestosql.SystemSessionProperties.isEnableStarTreeIndex) Patterns.anyPlan(io.prestosql.sql.planner.plan.Patterns.anyPlan) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) CubeManager(io.prestosql.cube.CubeManager) PlanNodeIdAllocator(io.prestosql.spi.plan.PlanNodeIdAllocator) FeaturesConfig(io.prestosql.sql.analyzer.FeaturesConfig) CubeMetadata(io.hetu.core.spi.cube.CubeMetadata) Patterns.tableScan(io.prestosql.sql.planner.plan.Patterns.tableScan) Comparator(java.util.Comparator) Expression(io.prestosql.sql.tree.Expression) AggregationSignature(io.hetu.core.spi.cube.aggregator.AggregationSignature) CubeMetadata(io.hetu.core.spi.cube.CubeMetadata) CubeStatement(io.hetu.core.spi.cube.CubeStatement) PrestoWarning(io.prestosql.spi.PrestoWarning) TableHandle(io.prestosql.spi.metadata.TableHandle) LongSupplier(java.util.function.LongSupplier)

Example 18 with AggregationNode

use of io.prestosql.spi.plan.AggregationNode in project hetu-core by openlookeng.

the class ScalarAggregationToJoinRewriter method createAggregationNode.

private Optional<AggregationNode> createAggregationNode(AggregationNode scalarAggregation, JoinNode leftOuterJoin, Symbol nonNullableAggregationSourceSymbol) {
    ImmutableMap.Builder<Symbol, Aggregation> aggregations = ImmutableMap.builder();
    for (Map.Entry<Symbol, Aggregation> entry : scalarAggregation.getAggregations().entrySet()) {
        Aggregation aggregation = entry.getValue();
        Symbol symbol = entry.getKey();
        if (functionResolution.isCountFunction(entry.getValue().getFunctionHandle())) {
            aggregations.put(symbol, new Aggregation(new CallExpression("count", functionResolution.countFunction(planSymbolAllocator.getTypes().get(nonNullableAggregationSourceSymbol)), BIGINT, ImmutableList.of(castToRowExpression(toSymbolReference(nonNullableAggregationSourceSymbol)))), ImmutableList.of(castToRowExpression(toSymbolReference(nonNullableAggregationSourceSymbol))), false, Optional.empty(), Optional.empty(), aggregation.getMask()));
        } else {
            aggregations.put(symbol, aggregation);
        }
    }
    return Optional.of(new AggregationNode(idAllocator.getNextId(), leftOuterJoin, aggregations.build(), singleGroupingSet(leftOuterJoin.getLeft().getOutputSymbols()), ImmutableList.of(), scalarAggregation.getStep(), scalarAggregation.getHashSymbol(), Optional.empty(), scalarAggregation.getAggregationType(), scalarAggregation.getFinalizeSymbol()));
}
Also used : Aggregation(io.prestosql.spi.plan.AggregationNode.Aggregation) Symbol(io.prestosql.spi.plan.Symbol) AggregationNode(io.prestosql.spi.plan.AggregationNode) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) CallExpression(io.prestosql.spi.relation.CallExpression) ImmutableMap(com.google.common.collect.ImmutableMap)

Example 19 with AggregationNode

use of io.prestosql.spi.plan.AggregationNode in project boostkit-bigdata by kunpengcompute.

the class TestHivePartialAggregationPushdown method testPartialAggregationAndProjectPushdown.

@Test
public void testPartialAggregationAndProjectPushdown() {
    // select count(x + 5) from table group by x
    TableScanNode tableScanNode = buildTableScanNode(COLUMN_INT);
    CallExpression callExpression = createOperationExpression(OperatorType.ADD, new VariableReferenceExpression(COLUMN_INT.getName(), INTEGER), new ConstantExpression(5, INTEGER));
    List<Symbol> symbols = ImmutableList.of(new Symbol(COLUMN_INT.getName()));
    List<RowExpression> rowExpressions = ImmutableList.of(callExpression);
    ProjectNode projectNode = buildProjectNode(tableScanNode, symbols, rowExpressions);
    AggregationNode aggregationNode = buildCountAggregationNode(projectNode);
    PlanNode output = AGGREGATION_OPTIMIZER.optimize(aggregationNode, OFFLOAD_SESSION, COLUMN_TYPE_MAP, SYMBOL_ALLOCATOR, ID_ALLOCATOR);
    Assignments assignmentsExpected = buildAssignments(symbols, rowExpressions);
    matchProjection(output, assignmentsExpected.getMap());
}
Also used : PlanNode(io.prestosql.spi.plan.PlanNode) TableScanNode(io.prestosql.spi.plan.TableScanNode) TestHivePushdownUtil.buildTableScanNode(io.prestosql.plugin.hive.rule.TestHivePushdownUtil.buildTableScanNode) VariableReferenceExpression(io.prestosql.spi.relation.VariableReferenceExpression) Symbol(io.prestosql.spi.plan.Symbol) ConstantExpression(io.prestosql.spi.relation.ConstantExpression) Assignments(io.prestosql.spi.plan.Assignments) TestHivePushdownUtil.buildAssignments(io.prestosql.plugin.hive.rule.TestHivePushdownUtil.buildAssignments) RowExpression(io.prestosql.spi.relation.RowExpression) TestHivePushdownUtil.buildProjectNode(io.prestosql.plugin.hive.rule.TestHivePushdownUtil.buildProjectNode) ProjectNode(io.prestosql.spi.plan.ProjectNode) TestHivePushdownUtil.buildAggregationNode(io.prestosql.plugin.hive.rule.TestHivePushdownUtil.buildAggregationNode) AggregationNode(io.prestosql.spi.plan.AggregationNode) CallExpression(io.prestosql.spi.relation.CallExpression) Test(org.testng.annotations.Test)

Example 20 with AggregationNode

use of io.prestosql.spi.plan.AggregationNode in project hetu-core by openlookeng.

the class PushAggregationThroughOuterJoin method createAggregationOverNull.

private Optional<MappedAggregationInfo> createAggregationOverNull(AggregationNode referenceAggregation, PlanSymbolAllocator planSymbolAllocator, PlanNodeIdAllocator idAllocator, Lookup lookup) {
    // Create a values node that consists of a single row of nulls.
    // Map the output symbols from the referenceAggregation's source
    // to symbol references for the new values node.
    ImmutableList.Builder<Symbol> nullSymbols = ImmutableList.builder();
    ImmutableList.Builder<RowExpression> nullLiterals = ImmutableList.builder();
    ImmutableMap.Builder<VariableReferenceExpression, VariableReferenceExpression> sourcesSymbolMappingBuilder = ImmutableMap.builder();
    for (Symbol sourceSymbol : referenceAggregation.getSource().getOutputSymbols()) {
        RowExpression nullLiteral = new ConstantExpression(null, planSymbolAllocator.getTypes().get(sourceSymbol));
        nullLiterals.add(nullLiteral);
        Symbol nullSymbol = planSymbolAllocator.newSymbol(nullLiteral);
        nullSymbols.add(nullSymbol);
        sourcesSymbolMappingBuilder.put(toVariableReference(sourceSymbol, planSymbolAllocator.getTypes().get(sourceSymbol)), toVariableReference(nullSymbol, nullLiteral.getType()));
    }
    ValuesNode nullRow = new ValuesNode(idAllocator.getNextId(), nullSymbols.build(), ImmutableList.of(nullLiterals.build()));
    Map<VariableReferenceExpression, VariableReferenceExpression> sourcesSymbolMapping = sourcesSymbolMappingBuilder.build();
    // For each aggregation function in the reference node, create a corresponding aggregation function
    // that points to the nullRow. Map the symbols from the aggregations in referenceAggregation to the
    // symbols in these new aggregations.
    ImmutableMap.Builder<Symbol, Symbol> aggregationsSymbolMappingBuilder = ImmutableMap.builder();
    ImmutableMap.Builder<Symbol, AggregationNode.Aggregation> aggregationsOverNullBuilder = ImmutableMap.builder();
    for (Map.Entry<Symbol, AggregationNode.Aggregation> entry : referenceAggregation.getAggregations().entrySet()) {
        Symbol aggregationSymbol = entry.getKey();
        AggregationNode.Aggregation aggregation = entry.getValue();
        if (!isUsingVariables(aggregation, sourcesSymbolMapping.keySet())) {
            return Optional.empty();
        }
        Aggregation overNullAggregation = new Aggregation(new CallExpression(aggregation.getFunctionCall().getDisplayName(), aggregation.getFunctionCall().getFunctionHandle(), aggregation.getFunctionCall().getType(), aggregation.getArguments().stream().map(argument -> inlineVariables(sourcesSymbolMapping, argument)).collect(toImmutableList()), Optional.empty()), aggregation.getArguments().stream().map(argument -> inlineVariables(sourcesSymbolMapping, argument)).collect(toImmutableList()), aggregation.isDistinct(), aggregation.getFilter(), aggregation.getOrderingScheme(), aggregation.getMask());
        Symbol overNullSymbol = planSymbolAllocator.newSymbol(overNullAggregation.getFunctionCall().getDisplayName(), planSymbolAllocator.getTypes().get(aggregationSymbol));
        aggregationsOverNullBuilder.put(overNullSymbol, overNullAggregation);
        aggregationsSymbolMappingBuilder.put(aggregationSymbol, overNullSymbol);
    }
    Map<Symbol, Symbol> aggregationsSymbolMapping = aggregationsSymbolMappingBuilder.build();
    // create an aggregation node whose source is the null row.
    AggregationNode aggregationOverNullRow = new AggregationNode(idAllocator.getNextId(), nullRow, aggregationsOverNullBuilder.build(), globalAggregation(), ImmutableList.of(), AggregationNode.Step.SINGLE, Optional.empty(), Optional.empty(), AggregationNode.AggregationType.HASH, Optional.empty());
    return Optional.of(new MappedAggregationInfo(aggregationOverNullRow, aggregationsSymbolMapping));
}
Also used : Patterns.source(io.prestosql.sql.planner.plan.Patterns.source) ConstantExpression(io.prestosql.spi.relation.ConstantExpression) Lookup(io.prestosql.sql.planner.iterative.Lookup) Patterns.aggregation(io.prestosql.sql.planner.plan.Patterns.aggregation) Patterns.join(io.prestosql.sql.planner.plan.Patterns.join) Pattern(io.prestosql.matching.Pattern) SystemSessionProperties.shouldPushAggregationThroughJoin(io.prestosql.SystemSessionProperties.shouldPushAggregationThroughJoin) AggregationNode(io.prestosql.spi.plan.AggregationNode) HashSet(java.util.HashSet) CallExpression(io.prestosql.spi.relation.CallExpression) Capture.newCapture(io.prestosql.matching.Capture.newCapture) ImmutableList(com.google.common.collect.ImmutableList) RowExpressionVariableInliner.inlineVariables(io.prestosql.sql.planner.RowExpressionVariableInliner.inlineVariables) Map(java.util.Map) Session(io.prestosql.Session) SpecialForm(io.prestosql.spi.relation.SpecialForm) AggregationNode.globalAggregation(io.prestosql.spi.plan.AggregationNode.globalAggregation) JoinNode(io.prestosql.spi.plan.JoinNode) AggregationNode.singleGroupingSet(io.prestosql.spi.plan.AggregationNode.singleGroupingSet) Symbol(io.prestosql.spi.plan.Symbol) ImmutableMap(com.google.common.collect.ImmutableMap) Assignments(io.prestosql.spi.plan.Assignments) Rule(io.prestosql.sql.planner.iterative.Rule) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Set(java.util.Set) PlanNode(io.prestosql.spi.plan.PlanNode) VariableReferenceExpression(io.prestosql.spi.relation.VariableReferenceExpression) ProjectNode(io.prestosql.spi.plan.ProjectNode) VariableReferenceSymbolConverter.toVariableReference(io.prestosql.sql.planner.VariableReferenceSymbolConverter.toVariableReference) COALESCE(io.prestosql.spi.relation.SpecialForm.Form.COALESCE) Preconditions.checkState(com.google.common.base.Preconditions.checkState) PlanSymbolAllocator(io.prestosql.sql.planner.PlanSymbolAllocator) Captures(io.prestosql.matching.Captures) ValuesNode(io.prestosql.spi.plan.ValuesNode) List(java.util.List) Aggregation(io.prestosql.spi.plan.AggregationNode.Aggregation) DistinctOutputQueryUtil.isDistinct(io.prestosql.sql.planner.optimizations.DistinctOutputQueryUtil.isDistinct) Capture(io.prestosql.matching.Capture) PlanNodeIdAllocator(io.prestosql.spi.plan.PlanNodeIdAllocator) RowExpression(io.prestosql.spi.relation.RowExpression) Optional(java.util.Optional) ValuesNode(io.prestosql.spi.plan.ValuesNode) ImmutableList(com.google.common.collect.ImmutableList) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Symbol(io.prestosql.spi.plan.Symbol) ConstantExpression(io.prestosql.spi.relation.ConstantExpression) RowExpression(io.prestosql.spi.relation.RowExpression) AggregationNode(io.prestosql.spi.plan.AggregationNode) ImmutableMap(com.google.common.collect.ImmutableMap) Aggregation(io.prestosql.spi.plan.AggregationNode.Aggregation) AggregationNode.globalAggregation(io.prestosql.spi.plan.AggregationNode.globalAggregation) Aggregation(io.prestosql.spi.plan.AggregationNode.Aggregation) VariableReferenceExpression(io.prestosql.spi.relation.VariableReferenceExpression) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) CallExpression(io.prestosql.spi.relation.CallExpression)

Aggregations

AggregationNode (io.prestosql.spi.plan.AggregationNode)52 Symbol (io.prestosql.spi.plan.Symbol)40 PlanNode (io.prestosql.spi.plan.PlanNode)30 ProjectNode (io.prestosql.spi.plan.ProjectNode)24 Map (java.util.Map)23 CallExpression (io.prestosql.spi.relation.CallExpression)20 ImmutableMap (com.google.common.collect.ImmutableMap)17 Assignments (io.prestosql.spi.plan.Assignments)16 Aggregation (io.prestosql.spi.plan.AggregationNode.Aggregation)14 RowExpression (io.prestosql.spi.relation.RowExpression)14 Expression (io.prestosql.sql.tree.Expression)14 List (java.util.List)14 ImmutableList (com.google.common.collect.ImmutableList)13 TableScanNode (io.prestosql.spi.plan.TableScanNode)13 Optional (java.util.Optional)13 OriginalExpressionUtils.castToRowExpression (io.prestosql.sql.relational.OriginalExpressionUtils.castToRowExpression)12 Test (org.testng.annotations.Test)12 Session (io.prestosql.Session)11 FilterNode (io.prestosql.spi.plan.FilterNode)11 Metadata (io.prestosql.metadata.Metadata)9