Package io.crate.operation

Examples of io.crate.operation.Input


                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; }};


            @Override
            public Object value() {
View Full Code Here


                Arrays.<Symbol>asList(new InputColumn(0)),
                Aggregation.Step.ITER,
                Aggregation.Step.FINAL
        );

        Input dummyInput = new Input() {

            @Override
            public Object value() {
                return 300L;
            }
View Full Code Here

                new FunctionInfo(
                    ident,
                    DataTypes.DOUBLE)
        );

        Input inputSet = new Input<Set<Long>>() {
            @Override
            public Set<Long> value() {
                return new HashSet<Long>(){{
                    add(3L);
                    add(7L);
View Full Code Here

        assertThat((Boolean) ((Input) symbol).value(), is(true));
    }

    @Test
    public void testEvaluateWithInputThatReturnsNull() throws Exception {
        Boolean result = predicate.evaluate(new Input[]{new Input() {
            @Override
            public Object value() {
                return null;
            }
        }});
View Full Code Here

                new FunctionInfo(
                        ident,
                        DataTypes.LONG)
        );

        Input inputSet = new Input<Set<String>>() {
            @Override
            public Set<String> value() {
                return new HashSet<String>(){{
                    add("foo");
                    add("bar");
View Full Code Here

        Scalar implementation = (Scalar)functions.get(new FunctionIdent(DateTruncTimeZoneAwareFunction.NAME,
                Arrays.<DataType>asList(DataTypes.STRING, DataTypes.STRING, DataTypes.LONG)));
        assertNotNull(implementation);

        Object day = implementation.evaluate(
                new Input() {
                    @Override
                    public BytesRef value() {
                        return new BytesRef("day");
                    }
                },
                new Input() {
                    @Override
                    public BytesRef value() {
                        return new BytesRef("Europe/Vienna");
                    }
                },
                new Input() {
                    @Override
                    public Long value() {
                        return 1401777485000L;
                    }
                }
View Full Code Here

                .createInjector().getInstance(Functions.class);
    }

    private Number evaluate(Number number, DataType dataType) {
        List<DataType> dataTypes = Arrays.asList(dataType);
        Input input = (Input) Literal.newLiteral(dataType, number);
        return getFunction(dataTypes).evaluate(input);
    }
View Full Code Here

                .createInjector().getInstance(Functions.class);
    }

    private Number evaluate(Number number, DataType dataType) {
        List<DataType> dataTypes = Arrays.asList(dataType);
        Input input = (Input) Literal.newLiteral(dataType, number);
        return getFunction(dataTypes).evaluate(input);
    }
View Full Code Here

    public Symbol visitReference(Reference symbol, Void context) {
        if (symbol.info().granularity().ordinal() > granularity.ordinal()) {
            return symbol;
        }

        Input input = (Input) referenceResolver.getImplementation(symbol.info().ident());
        if (input != null) {
            return Literal.newLiteral(symbol.info().type(), input.value());
        }

        if (logger.isTraceEnabled()) {
            logger.trace(SymbolFormatter.format("Can't resolve reference %s", symbol));
        }
View Full Code Here

                String fieldName = distanceRefLiteral.reference().info().ident().columnIdent().fqn();
                FieldMapper mapper = getGeoPointFieldMapper(fieldName);
                GeoPointFieldMapper geoMapper = ((GeoPointFieldMapper) mapper);
                IndexGeoPointFieldData<?> fieldData = searchContext.fieldData().getForField(mapper);

                Input geoPointInput = distanceRefLiteral.input();
                Double[] pointValue = (Double[]) geoPointInput.value();
                double lat = pointValue[1];
                double lon = pointValue[0];

                String parentName = functionLiteralPair.functionName();
View Full Code Here

TOP

Related Classes of io.crate.operation.Input

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.