Package com.facebook.presto.metadata

Examples of com.facebook.presto.metadata.Signature


    }

    // **************** special forms (lazy evaluation, etc) ****************
    public static Signature ifSignature(Type returnType)
    {
        return new Signature(IF, returnType);
    }
View Full Code Here


        return new Signature(IF, returnType);
    }

    public static Signature nullIfSignature(Type returnType, Type firstType, Type secondType)
    {
        return new Signature(NULL_IF, returnType, firstType, secondType);
    }
View Full Code Here

        return new Signature(NULL_IF, returnType, firstType, secondType);
    }

    public static Signature switchSignature(Type returnType)
    {
        return new Signature(SWITCH, returnType);
    }
View Full Code Here

        return new Signature(SWITCH, returnType);
    }

    public static Signature whenSignature(Type returnType)
    {
        return new Signature("WHEN", returnType);
    }
View Full Code Here

        protected RowExpression visitFunctionCall(FunctionCall node, Void context)
        {
            List<RowExpression> arguments = Lists.transform(node.getArguments(), processFunction(context));

            List<Type> argumentTypes = Lists.transform(arguments, typeGetter());
            Signature signature = new Signature(node.getName().getSuffix(), types.get(node), argumentTypes, false, false);

            return call(signature, arguments);
        }
View Full Code Here

                for (Expression argument : entry.getValue().getArguments()) {
                    Symbol argumentSymbol = Symbol.fromQualifiedName(((QualifiedNameReference) argument).getName());
                    arguments.add(source.getLayout().get(argumentSymbol));
                }
                Symbol symbol = entry.getKey();
                Signature signature = node.getSignatures().get(symbol);
                windowFunctions.add(metadata.getExactFunction(signature).bindWindowFunction(arguments.build()));
                windowFunctionOutputSymbols.add(symbol);
            }

            // compute the layout of the output from the window operator
View Full Code Here

        TypeRegistry typeRegistry = new TypeRegistry();
        typeRegistry.addType(new ClassifierType());
        typeRegistry.addType(new RegressorType());
        typeRegistry.addType(new ModelType());
        metadata.addFunctions(new MLFunctionFactory(typeRegistry).listFunctions());
        InternalAggregationFunction aggregation = metadata.getExactFunction(new Signature("evaluate_classifier_predictions", StandardTypes.VARCHAR, StandardTypes.BIGINT, StandardTypes.BIGINT)).getAggregationFunction();
        Accumulator accumulator = aggregation.bind(ImmutableList.of(0, 1), Optional.<Integer>absent(), Optional.<Integer>absent(), 1.0).createAccumulator();
        accumulator.addInput(getPage());
        Block block = accumulator.evaluateFinal();

        String output = VARCHAR.getSlice(block, 0).toStringUtf8();
View Full Code Here

            Map<Symbol, FunctionCall> finalCalls = new HashMap<>();
            Map<Symbol, FunctionCall> intermediateCalls = new HashMap<>();
            Map<Symbol, Signature> intermediateFunctions = new HashMap<>();
            Map<Symbol, Symbol> intermediateMask = new HashMap<>();
            for (Map.Entry<Symbol, FunctionCall> entry : aggregations.entrySet()) {
                Signature signature = functions.get(entry.getKey());
                FunctionInfo function = metadata.getFunction(signature);

                Symbol intermediateSymbol = allocator.newSymbol(function.getName().getSuffix(), function.getIntermediateType());
                intermediateCalls.put(intermediateSymbol, entry.getValue());
                intermediateFunctions.put(intermediateSymbol, signature);
View Full Code Here

        return new FunctionCall(QualifiedName.of("test"), ImmutableList.<Expression>of());
    }

    private static Signature fakeFunctionHandle(String name)
    {
        return new Signature(name, UNKNOWN, ImmutableList.<Type>of(), false);
    }
View Full Code Here

        if (type.equals(BOOLEAN)) {
            return new BooleanLiteral(object.toString());
        }

        Signature signature = FunctionRegistry.getMagicLiteralFunctionSignature(type);
        Expression rawLiteral = toExpression(object, FunctionRegistry.type(type.getJavaType()));
        return new FunctionCall(new QualifiedName(signature.getName()), ImmutableList.of(rawLiteral));
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.metadata.Signature

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.