Examples of InputColumn


Examples of io.crate.planner.symbol.InputColumn

        FunctionIdent minAggIdent = new FunctionIdent(MinimumAggregation.NAME, Arrays.<DataType>asList(DataTypes.DOUBLE));
        minAggFunction = (AggregationFunction<MinimumAggregation.MinimumAggState>) functions.get(minAggIdent);

        groupProjection = new GroupProjection();
        groupProjection.keys(Arrays.<DataTypeSymbol>asList(new InputColumn(0, DataTypes.INTEGER)));
        groupProjection.values(Arrays.asList(
                new Aggregation(minAggFunction.info(), Arrays.<Symbol>asList(new InputColumn(1)), Aggregation.Step.PARTIAL, Aggregation.Step.FINAL)
        ));
    }
View Full Code Here

Examples of io.crate.planner.symbol.InputColumn

    @Test
    public void testLocalMerge() throws Exception {
        for (int run = 0; run < 100; run++) {
            TopNProjection topNProjection = new TopNProjection(3,
                    TopN.NO_OFFSET,
                    Arrays.<Symbol>asList(new InputColumn(0), new InputColumn(1)),
                    new boolean[]{true, true},
                    new Boolean[] { null, null });
            topNProjection.outputs(Arrays.<Symbol>asList(new InputColumn(0), new InputColumn(1)));

            MergeNode mergeNode = new MergeNode("merge", 2);
            mergeNode.projections(Arrays.<Projection>asList(
                    groupProjection,
                    topNProjection
View Full Code Here

Examples of io.crate.planner.symbol.InputColumn

        MergeNode dummyMergeNode = new MergeNode();
        dummyMergeNode.contextId(contextId);
        dummyMergeNode.inputTypes(Arrays.<DataType>asList(DataTypes.INTEGER, DataTypes.STRING));
        TopNProjection topNProjection = new TopNProjection(10, 0);
        topNProjection.outputs(Arrays.<Symbol>asList(
                new InputColumn(0, DataTypes.INTEGER),
                new InputColumn(1, DataTypes.INTEGER)));
        dummyMergeNode.projections(Arrays.<Projection>asList(topNProjection));

        DistributedRequestContextManager contextManager =
                new DistributedRequestContextManager(new DummyDownstreamOperationFactory(rows), functions,
                        new StatsTables(ImmutableSettings.EMPTY, mock(NodeSettingsService.class)));
View Full Code Here

Examples of io.crate.planner.symbol.InputColumn

        mergeNode.contextId(UUID.randomUUID());
        mergeNode.executionNodes(nodes);
        mergeNode.inputTypes(Arrays.<DataType>asList(DataTypes.UNDEFINED, DataTypes.STRING));

        GroupProjection groupProjection = new GroupProjection();
        groupProjection.keys(Arrays.<DataTypeSymbol>asList(new InputColumn(1, DataTypes.STRING)));
        groupProjection.values(Arrays.asList(
                new Aggregation(
                        countAggregation.info(),
                        ImmutableList.<Symbol>of(new InputColumn(0)),
                        Aggregation.Step.PARTIAL,
                        Aggregation.Step.FINAL
                )
        ));
        TopNProjection topNProjection = new TopNProjection(
                10, 0, Arrays.<Symbol>asList(new InputColumn(1)), new boolean[] { false }, new Boolean[] { null });
        topNProjection.outputs(Arrays.<Symbol>asList(new InputColumn(0), new InputColumn(1)));

        mergeNode.projections(Arrays.asList(groupProjection, topNProjection));
        mergeNode.outputTypes(Arrays.<DataType>asList(DataTypes.STRING, DataTypes.LONG));

        Streamer<?>[] mapperOutputStreamer = new Streamer[] {
View Full Code Here

Examples of io.crate.planner.symbol.InputColumn

    @Test
    public void testAggregationFromPartial() {
        Aggregation aggregation = new Aggregation(
                countImpl.info(),
                Arrays.<Symbol>asList(new InputColumn(0)),
                Aggregation.Step.PARTIAL,
                Aggregation.Step.FINAL
        );
        Input dummyInput = new Input() {
            CountAggregation.CountAggState state = new CountAggregation.CountAggState() {{ value = 10L; }};
View Full Code Here

Examples of io.crate.planner.symbol.InputColumn

    @Test
    public void testAggregationFromIterToFinal() {
        Aggregation aggregation = new Aggregation(
                countImpl.info(),
                Arrays.<Symbol>asList(new InputColumn(0)),
                Aggregation.Step.ITER,
                Aggregation.Step.FINAL
        );

        Input dummyInput = new Input() {
View Full Code Here

Examples of io.crate.planner.symbol.InputColumn

        FunctionIdent minAggIdent = new FunctionIdent(MinimumAggregation.NAME, Arrays.<DataType>asList(DataTypes.DOUBLE));
        FunctionInfo minAggInfo = new FunctionInfo(minAggIdent, DataTypes.DOUBLE);
        minAggFunction = (AggregationFunction<MinimumAggregation.MinimumAggState>) functions.get(minAggIdent);

        groupProjection = new GroupProjection();
        groupProjection.keys(Arrays.<DataTypeSymbol>asList(new InputColumn(0, DataTypes.INTEGER)));
        groupProjection.values(Arrays.asList(
                new Aggregation(minAggInfo, Arrays.<Symbol>asList(new InputColumn(1)),
                        Aggregation.Step.PARTIAL, Aggregation.Step.FINAL)
        ));
    }
View Full Code Here

Examples of io.crate.planner.symbol.InputColumn

    }

    @Test
    public void testMergeSingleResult() throws Exception {
        TopNProjection topNProjection = new TopNProjection(3, TopN.NO_OFFSET,
                Arrays.<Symbol>asList(new InputColumn(0)), new boolean[]{false}, new Boolean[] { null });
        topNProjection.outputs(Arrays.<Symbol>asList(new InputColumn(0), new InputColumn(1)));

        MergeNode mergeNode = new MergeNode("merge", 2); // no need for inputTypes here
        mergeNode.projections(Arrays.asList(
                groupProjection,
                topNProjection
View Full Code Here

Examples of io.crate.planner.symbol.InputColumn

public class FilterProjectionTest {

    @Test
    public void testStreaming() throws Exception {
        FilterProjection p = new FilterProjection();
        p.outputs(ImmutableList.<Symbol>of(new InputColumn(1)));
        p.requiredGranularity(RowGranularity.SHARD);
        p.query(TestingHelpers.createFunction(AndOperator.NAME, DataTypes.BOOLEAN, Literal.newLiteral(true), Literal.newLiteral(false)));

        BytesStreamOutput out = new BytesStreamOutput();
        Projection.toStream(p, out);
View Full Code Here

Examples of io.crate.planner.symbol.InputColumn

    protected void generateSymbols(int[] primaryKeyIndices,
                                   int[] partitionedByIndices,
                                   int clusteredByIdx) {
        this.idSymbols = new ArrayList<>(primaryKeys.size());
        for (int primaryKeyIndex : primaryKeyIndices) {
            idSymbols.add(new InputColumn(primaryKeyIndex, null));
        }

        this.partitionedBySymbols = new ArrayList<>(partitionedByIndices.length);
        for (int partitionByIndex : partitionedByIndices) {
            partitionedBySymbols.add(new InputColumn(partitionByIndex, null));
        }
        if (clusteredByIdx >= 0) {
            clusteredBySymbol = new InputColumn(clusteredByIdx, null);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.