Package io.crate.planner.node.dql

Examples of io.crate.planner.node.dql.CollectNode


    static CollectNode distributingCollect(AbstractDataAnalysis analysis,
                                           List<Symbol> toCollect,
                                           List<String> downstreamNodes,
                                           ImmutableList<Projection> projections) {
        CollectNode node = new CollectNode("distributing collect", analysis.table().getRouting(analysis.whereClause()));
        node.whereClause(analysis.whereClause());
        node.maxRowGranularity(analysis.rowGranularity());
        node.downStreamNodes(downstreamNodes);
        node.toCollect(toCollect);
        node.projections(projections);

        node.isPartitioned(analysis.table().isPartitioned());
        setOutputTypes(node);
        return node;
    }
View Full Code Here


        Routing routing = analysis.table().getRouting(analysis.whereClause());
        if (partitionIdent != null && routing.hasLocations()) {
            routing = filterRouting(routing, PartitionName.fromPartitionIdent(
                            analysis.table().ident().name(), partitionIdent).stringValue());
        }
        CollectNode node = new CollectNode("collect", routing);
        node.whereClause(analysis.whereClause());
        node.toCollect(toCollect);
        node.maxRowGranularity(analysis.rowGranularity());
        node.projections(projections);
        node.isPartitioned(analysis.table().isPartitioned());
        setOutputTypes(node);
        return node;
    }
View Full Code Here

                CountAggregation.COUNT_STAR_FUNCTION,
                ImmutableList.<Symbol>of(new InputColumn(0, DataTypes.LONG)),
                Aggregation.Step.PARTIAL,
                Aggregation.Step.FINAL);

        CollectNode collectNode = new CollectNode(
                "count",
                table.getRouting(WhereClause.MATCH_ALL),
                ImmutableList.<Symbol>of(),
                Arrays.<Projection>asList(new AggregationProjection(ImmutableList.of(countAggregationPartial))));
        collectNode.maxRowGranularity(RowGranularity.DOC);
        collectNode.outputTypes(ImmutableList.<DataType>of(DataTypes.UNDEFINED));
        MergeNode mergeNode = new MergeNode("local count merge", collectNode.executionNodes().size());
        mergeNode.projections(ImmutableList.<Projection>of(new AggregationProjection(ImmutableList.of(countAggregationFinal))));
        Plan plan = new Plan();
        plan.add(collectNode);
        plan.add(mergeNode);
        return plan;
View Full Code Here

     * @return collector wrapping different collect implementations, call {@link CrateCollector#doCollect()} to start
     * collecting with this collector
     */
    public CrateCollector getCollector(CollectNode collectNode,
                                       ShardProjectorChain projectorChain) throws Exception {
        CollectNode normalizedCollectNode = collectNode.normalize(shardNormalizer);
        Projector downstream = projectorChain.newShardDownstreamProjector(projectorVisitor);

        if (normalizedCollectNode.whereClause().noMatch()) {
            return CrateCollector.NOOP;
        } else {
            RowGranularity granularity = normalizedCollectNode.maxRowGranularity();
            if (granularity == RowGranularity.DOC) {
                if (isBlobShard) {
                    return getBlobIndexCollector(normalizedCollectNode, downstream);
                } else {
                    return getLuceneIndexCollector(normalizedCollectNode, downstream);
View Full Code Here

TOP

Related Classes of io.crate.planner.node.dql.CollectNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.