Package com.facebook.presto.operator.scalar

Examples of com.facebook.presto.operator.scalar.ScalarOperator


        }

        private boolean processScalarOperator(Method method)
                throws IllegalAccessException
        {
            ScalarOperator scalarOperator = method.getAnnotation(ScalarOperator.class);
            if (scalarOperator == null) {
                return false;
            }
            checkValidMethod(method);
            MethodHandle methodHandle = lookup().unreflect(method);
            OperatorType operatorType = scalarOperator.value();

            List<Type> parameterTypes = parameterTypes(method);

            Type returnType;
            if (operatorType == OperatorType.HASH_CODE) {
                // todo hack for hashCode... should be int
                returnType = BIGINT;
            }
            else {
                SqlType explicitType = method.getAnnotation(SqlType.class);
                checkArgument(explicitType != null, "Method %s return type does not have a @SqlType annotation", method);
                returnType = type(explicitType);

                verifyMethodSignature(method, returnType, parameterTypes);
            }

            FunctionBinder functionBinder = createFunctionBinder(method, scalarOperator.functionBinder());

            operator(operatorType, returnType, parameterTypes, methodHandle, functionBinder);
            return true;
        }
View Full Code Here


        }

        private boolean processScalarOperator(Method method)
                throws IllegalAccessException
        {
            ScalarOperator scalarOperator = method.getAnnotation(ScalarOperator.class);
            if (scalarOperator == null) {
                return false;
            }
            checkValidMethod(method);
            MethodHandle methodHandle = lookup().unreflect(method);
            OperatorType operatorType = scalarOperator.value();

            List<Type> parameterTypes = parameterTypes(method);

            Type returnType;
            if (operatorType == OperatorType.HASH_CODE) {
                // todo hack for hashCode... should be int
                returnType = BIGINT;
            }
            else {
                SqlType explicitType = method.getAnnotation(SqlType.class);
                checkArgument(explicitType != null, "Method %s return type does not have a @SqlType annotation", method);
                returnType = type(explicitType);

                verifyMethodSignature(method, returnType, parameterTypes);
            }

            FunctionBinder functionBinder = createFunctionBinder(method, scalarOperator.functionBinder());

            operator(operatorType, returnType, parameterTypes, methodHandle, functionBinder);
            return true;
        }
View Full Code Here

        }

        private boolean processScalarOperator(Method method)
                throws IllegalAccessException
        {
            ScalarOperator scalarOperator = method.getAnnotation(ScalarOperator.class);
            if (scalarOperator == null) {
                return false;
            }
            checkValidMethod(method);
            MethodHandle methodHandle = lookup().unreflect(method);
            OperatorType operatorType = scalarOperator.value();

            List<Type> parameterTypes = parameterTypes(method);

            Type returnType;
            if (operatorType == OperatorType.HASH_CODE) {
                // todo hack for hashCode... should be int
                returnType = BIGINT;
            }
            else {
                SqlType explicitType = method.getAnnotation(SqlType.class);
                checkArgument(explicitType != null, "Method %s return type does not have a @SqlType annotation", method);
                returnType = type(explicitType);

                verifyMethodSignature(method, returnType, parameterTypes);
            }

            FunctionBinder functionBinder = createFunctionBinder(method, scalarOperator.functionBinder());

            operator(operatorType, returnType, parameterTypes, methodHandle, functionBinder);
            return true;
        }
View Full Code Here

        }

        private boolean processScalarOperator(Method method)
                throws IllegalAccessException
        {
            ScalarOperator scalarOperator = method.getAnnotation(ScalarOperator.class);
            if (scalarOperator == null) {
                return false;
            }
            checkValidMethod(method);
            MethodHandle methodHandle = lookup().unreflect(method);
            OperatorType operatorType = scalarOperator.value();

            List<Type> parameterTypes = parameterTypes(method);

            Type returnType;
            if (operatorType == OperatorType.HASH_CODE) {
View Full Code Here

    }

    private boolean processScalarOperator(Method method)
            throws IllegalAccessException
    {
        ScalarOperator scalarOperator = method.getAnnotation(ScalarOperator.class);
        if (scalarOperator == null) {
            return false;
        }
        checkValidMethod(method);
        MethodHandle methodHandle = lookup().unreflect(method);
        OperatorType operatorType = scalarOperator.value();

        List<Type> parameterTypes = parameterTypes(typeManager, method);

        Type returnType;
        if (operatorType == OperatorType.HASH_CODE) {
View Full Code Here

        }

        private boolean processScalarOperator(Method method)
                throws IllegalAccessException
        {
            ScalarOperator scalarOperator = method.getAnnotation(ScalarOperator.class);
            if (scalarOperator == null) {
                return false;
            }
            checkValidMethod(method);
            MethodHandle methodHandle = lookup().unreflect(method);
            OperatorType operatorType = scalarOperator.value();

            List<Type> parameterTypes = parameterTypes(method);

            Type returnType;
            if (operatorType == OperatorType.HASH_CODE) {
                // todo hack for hashCode... should be int
                returnType = BIGINT;
            }
            else {
                SqlType explicitType = method.getAnnotation(SqlType.class);
                checkArgument(explicitType != null, "Method %s return type does not have a @SqlType annotation", method);
                returnType = type(explicitType);

                verifyMethodSignature(method, returnType, parameterTypes);
            }

            FunctionBinder functionBinder = createFunctionBinder(method, scalarOperator.functionBinder());

            operator(operatorType, returnType, parameterTypes, methodHandle, functionBinder);
            return true;
        }
View Full Code Here

        }

        private boolean processScalarOperator(Method method)
                throws IllegalAccessException
        {
            ScalarOperator scalarOperator = method.getAnnotation(ScalarOperator.class);
            if (scalarOperator == null) {
                return false;
            }
            checkValidMethod(method);
            MethodHandle methodHandle = lookup().unreflect(method);
            OperatorType operatorType = scalarOperator.value();

            List<Type> parameterTypes = parameterTypes(method);

            Type returnType;
            if (operatorType == OperatorType.HASH_CODE) {
                // todo hack for hashCode... should be int
                returnType = BIGINT;
            }
            else {
                SqlType explicitType = method.getAnnotation(SqlType.class);
                checkArgument(explicitType != null, "Method %s return type does not have a @SqlType annotation", method);
                returnType = type(explicitType);

                verifyMethodSignature(method, returnType, parameterTypes);
            }

            FunctionBinder functionBinder = createFunctionBinder(method, scalarOperator.functionBinder());

            operator(operatorType, returnType, parameterTypes, methodHandle, functionBinder);
            return true;
        }
View Full Code Here

    }

    private boolean processScalarOperator(Method method)
            throws IllegalAccessException
    {
        ScalarOperator scalarOperator = method.getAnnotation(ScalarOperator.class);
        if (scalarOperator == null) {
            return false;
        }
        checkValidMethod(method);
        MethodHandle methodHandle = lookup().unreflect(method);
        OperatorType operatorType = scalarOperator.value();

        List<Type> parameterTypes = parameterTypes(typeManager, method);

        Type returnType;
        if (operatorType == OperatorType.HASH_CODE) {
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.scalar.ScalarOperator

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.