Package io.crate.metadata

Examples of io.crate.metadata.FunctionIdent


    public static void register(ScalarFunctionModule mod) {
        for (DataType t : DataTypes.NUMERIC_PRIMITIVE_TYPES) {
            mod.register(
                    new CollectionAverageFunction(
                            new FunctionInfo(new FunctionIdent(
                                    NAME, ImmutableList.<DataType>of(new SetType(t))), DataTypes.DOUBLE))
            );
        }
    }
View Full Code Here


public class DateTruncTimeZoneAwareFunction extends BaseDateTruncFunction {

    public static void register(ScalarFunctionModule module) {
        module.register(new DateTruncTimeZoneAwareFunction(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.<DataType>of(
                        DataTypes.STRING, DataTypes.STRING, DataTypes.TIMESTAMP)),
                DataTypes.TIMESTAMP)
        ));
        module.register(new DateTruncTimeZoneAwareFunction(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.<DataType>of(
                        DataTypes.STRING, DataTypes.STRING, DataTypes.LONG)),
                DataTypes.TIMESTAMP)
        ));
        module.register(new DateTruncTimeZoneAwareFunction(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.<DataType>of(
                        DataTypes.STRING, DataTypes.STRING, DataTypes.STRING)),
                DataTypes.TIMESTAMP)
        ));
    }
View Full Code Here

            throw new ScriptException("invalid parameter format");
        }
    }

    protected @Nullable Scalar getScalar(String name, @Nullable List<DataType> argumentTypes) {
        FunctionIdent functionIdent;
        if (argumentTypes == null|| argumentTypes.isEmpty()) {
            functionIdent = new FunctionIdent(name, ImmutableList.<DataType>of());
        } else {
            functionIdent = new FunctionIdent(name, argumentTypes);
        }
        return (Scalar)functions.get(functionIdent);
    }
View Full Code Here

    public static final String NAME = "sum";
    private final FunctionInfo info;

    public static void register(AggregationImplModule mod) {
        for (DataType t : DataTypes.NUMERIC_PRIMITIVE_TYPES) {
            mod.register(new SumAggregation(new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(t)),
                            DataTypes.DOUBLE, FunctionInfo.Type.AGGREGATE)));
        }

    }
View Full Code Here

        public FunctionImplementation<Function> getForTypes(List<DataType> dataTypes) throws IllegalArgumentException {
            if (dataTypes.size() == 0) {
                return new CountAggregation(COUNT_STAR_FUNCTION, false);
            } else {
                return new CountAggregation(
                        new FunctionInfo(new FunctionIdent(NAME, dataTypes),
                                DataTypes.LONG, FunctionInfo.Type.AGGREGATE),
                        true
                );
            }
        }
View Full Code Here

    private final FunctionInfo info;

    public static void register(AggregationImplModule mod) {
        for (DataType t :DataTypes.NUMERIC_PRIMITIVE_TYPES) {
            mod.register(new AverageAggregation(new FunctionInfo(
                            new FunctionIdent(NAME, ImmutableList.of(t)), DataTypes.DOUBLE,
                    FunctionInfo.Type.AGGREGATE)));
        }
        mod.register(new AverageAggregation(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.<DataType>of(DataTypes.TIMESTAMP)), DataTypes.DOUBLE,
                FunctionInfo.Type.AGGREGATE)));
    }
View Full Code Here

    public static void register(AggregationImplModule mod) {
        for (final DataType dataType : DataTypes.PRIMITIVE_TYPES) {
            mod.register(
                    new MaximumAggregation(
                            new FunctionInfo(new FunctionIdent(NAME,
                                    ImmutableList.of(dataType)),
                                    dataType, FunctionInfo.Type.AGGREGATE
                            )
                    ) {
                        @Override
View Full Code Here

    private final FunctionInfo info;

    public static void register(AggregationImplModule mod) {
        for (DataType t : DataTypes.PRIMITIVE_TYPES) {
            mod.register(new ArbitraryAggregation(
                    new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(t)), t, FunctionInfo.Type.AGGREGATE))
            );
        }
    }
View Full Code Here

        for (final DataType dataType : DataTypes.PRIMITIVE_TYPES) {
            final Streamer<?> setStreamer = new SetType(dataType).streamer();

            mod.register(
                    new CollectSetAggregation(
                            new FunctionInfo(new FunctionIdent(NAME,
                                    ImmutableList.of(dataType)),
                                    dataType, FunctionInfo.Type.AGGREGATE
                            )
                    ) {
                        @Override
View Full Code Here

    public static void register(AggregationImplModule mod) {
        for (final DataType dataType : DataTypes.PRIMITIVE_TYPES) {
            mod.register(
                    new MinimumAggregation(
                            new FunctionInfo(new FunctionIdent(NAME,
                                    ImmutableList.of(dataType)), dataType, FunctionInfo.Type.AGGREGATE)
                    ) {
                        @Override
                        public MinimumAggState newState() {
                            return new MinimumAggState() {
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.