Package io.crate.metadata

Examples of io.crate.metadata.FunctionIdent


                .add(new ScalarFunctionModule()).createInjector().getInstance(Functions.class);
    }


    private ToLongFunction getFunction(DataType type) {
        return (ToLongFunction) functions.get(new FunctionIdent(functionName, Arrays.asList(type)));
    }
View Full Code Here


    @Test
    public void testInvalidType() throws Exception {
        expectedException.expect(IllegalArgumentException.class);
        expectedException.expectMessage("type 'object' not supported for conversion");
        functions.get(new FunctionIdent(functionName, ImmutableList.<DataType>of(DataTypes.OBJECT)));
    }
View Full Code Here

                .add(new ScalarFunctionModule()).createInjector().getInstance(Functions.class);
    }


    private ToShortFunction getFunction(DataType type) {
        return (ToShortFunction) functions.get(new FunctionIdent(functionName, Arrays.asList(type)));
    }
View Full Code Here

    @Test
    public void testInvalidType() throws Exception {
        expectedException.expect(IllegalArgumentException.class);
        expectedException.expectMessage("type 'object' not supported for conversion");
        functions.get(new FunctionIdent(functionName, ImmutableList.<DataType>of(DataTypes.OBJECT)));
    }
View Full Code Here

        Reference nameRef = createReference("name", DataTypes.STRING);
        GroupProjection groupProjection = new GroupProjection();
        groupProjection.keys(Arrays.<DataTypeSymbol>asList(nameRef));
        groupProjection.values(Arrays.asList(
                new Aggregation(
                        new FunctionInfo(new FunctionIdent(CountAggregation.NAME, ImmutableList.<DataType>of()), DataTypes.LONG),
                        ImmutableList.<Symbol>of(),
                        Aggregation.Step.PARTIAL,
                        Aggregation.Step.FINAL
                )
        ));
View Full Code Here

        functions = new ModulesBuilder().add(new ScalarFunctionModule())
                .createInjector().getInstance(Functions.class);
    }

    private CeilFunction getFunction(DataType type) {
        return (CeilFunction) functions.get(new FunctionIdent(CeilFunction.NAME, Arrays.asList(type)));
    }
View Full Code Here

        Injector injector = new ModulesBuilder()
                .add(new TestModule())
                .createInjector();

        Functions functions = injector.getInstance(Functions.class);
        functions.get(new FunctionIdent(AddFunction.NAME,
                Arrays.<DataType>asList(DataTypes.TIMESTAMP, DataTypes.TIMESTAMP)));
    }
View Full Code Here

    private Integer evaluate(Float number) {
        return evaluate(number, DataTypes.FLOAT).intValue();
    }

    private RoundFunction getFunction(List<DataType> dataTypes) {
        return (RoundFunction)functions.get(new FunctionIdent(RoundFunction.NAME, dataTypes));
    }
View Full Code Here

        return executeAggregation("max", dataType, data);
    }

    @Test
    public void testReturnType() throws Exception {
        FunctionIdent fi = new FunctionIdent("max", ImmutableList.<DataType>of(DataTypes.INTEGER));
        assertEquals(DataTypes.INTEGER, functions.get(fi).info().returnType());
    }
View Full Code Here

        return executeAggregation("min", dataType, data);
    }

    @Test
    public void testReturnType() throws Exception {
        FunctionIdent fi = new FunctionIdent("min", ImmutableList.<DataType>of(DataTypes.INTEGER));
        assertEquals(DataTypes.INTEGER, functions.get(fi).info().returnType());
    }
View Full Code Here

TOP

Related Classes of io.crate.metadata.FunctionIdent

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.