Package io.crate.metadata

Examples of io.crate.metadata.FunctionIdent


            throw new ScriptException("first argument in search script no scalar!");
        }
        ScalarArgument function = ((ScalarArgument) operatorArgs.get(0));

        // resolve operator
        FunctionIdent operatorIdent = new FunctionIdent(operatorName, operatorArgTypes);
        Operator operator = (Operator)functions.get(operatorIdent);
        if (operator == null) {
            throw new ScriptException(String.format("Cannot resolve operator with ident %s", operatorIdent));
        }
View Full Code Here


    }

    public static void register(OperatorModule module) {
        for (DataType type : DataTypes.PRIMITIVE_TYPES) {
            FunctionInfo functionInfo = new FunctionInfo(
                    new FunctionIdent(NAME, ImmutableList.<DataType>of(type, new SetType(type))), DataTypes.BOOLEAN);
            module.registerOperatorFunction(new InOperator(functionInfo));
        }
    }
View Full Code Here

public abstract class Operator<I> extends Scalar<Boolean, I> implements FunctionImplementation<Function> {

    public static final io.crate.types.DataType RETURN_TYPE = DataTypes.BOOLEAN;

    protected static FunctionInfo generateInfo(String name, DataType type) {
        return new FunctionInfo(new FunctionIdent(name, ImmutableList.of(type, type)), RETURN_TYPE);
    }
View Full Code Here

        return builder.convert(eq).query;
    }

    private WhereClause eq(DataTypeSymbol left, DataTypeSymbol right) {
        return new WhereClause(new Function(new FunctionInfo(
                new FunctionIdent(EqOperator.NAME, Arrays.asList(left.valueType(), right.valueType())), DataTypes.BOOLEAN),
                Arrays.<Symbol>asList(left, right)
        ));
    }
View Full Code Here

    @Test
    public void testDistributedMergeTask() throws Exception {
        ClusterService clusterService = cluster().getInstance(ClusterService.class);
        Functions functions = cluster().getInstance(Functions.class);
        AggregationFunction countAggregation =
                (AggregationFunction)functions.get(new FunctionIdent(CountAggregation.NAME, ImmutableList.<DataType>of()));

        TransportMergeNodeAction transportMergeNodeAction = cluster().getInstance(TransportMergeNodeAction.class);

        Set<String> nodes = new HashSet<>();
        for (DiscoveryNode discoveryNode : clusterService.state().nodes()) {
View Full Code Here

    static class NoopFloorFunction extends FloorFunction {

        private final FunctionInfo info;

        NoopFloorFunction(DataType type) {
            info = new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(type)), type);
        }
View Full Code Here

         }
         return symbol;
    }

    protected static FunctionInfo genDoubleInfo(String functionName, List<DataType> dataTypes) {
             return new FunctionInfo(new FunctionIdent(functionName, dataTypes), DataTypes.DOUBLE);
    }
View Full Code Here

    protected static FunctionInfo genDoubleInfo(String functionName, List<DataType> dataTypes) {
             return new FunctionInfo(new FunctionIdent(functionName, dataTypes), DataTypes.DOUBLE);
    }

    protected static FunctionInfo genLongInfo(String functionName, List<DataType> dataTypes) {
        return new FunctionInfo(new FunctionIdent(functionName, dataTypes), DataTypes.LONG);
    }
View Full Code Here

    private static class NoopRoundFunction extends RoundFunction {
        private final FunctionInfo info;

        public NoopRoundFunction(DataType type) {
            info = new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(type)), type);
        }
View Full Code Here

    static class NoopCeilFunction extends CeilFunction {

        private final FunctionInfo info;

        NoopCeilFunction(DataType type) {
            info = new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(type)), type);
        }
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.