Package com.facebook.presto.sql.tree

Examples of com.facebook.presto.sql.tree.NullLiteral


            operands.add(process(expression, context));
        }

        Class<?> type = getType(operands);

        TypedByteCodeNode nullValue = coerceToType(context, process(new NullLiteral(), context), type);
        // reverse list because current if statement builder doesn't support if/else so we need to build the if statements bottom up
        for (TypedByteCodeNode operand : Lists.reverse(operands)) {
            Block condition = new Block(context)
                    .append(coerceToType(context, operand, type).getNode())
                    .getVariable("wasNull");
View Full Code Here


        if (object instanceof Boolean) {
            return new BooleanLiteral(object.toString());
        }

        if (object == null) {
            return new NullLiteral();
        }

        throw new UnsupportedOperationException("not yet implemented: " + object.getClass().getName());
    }
View Full Code Here

        if (object instanceof Boolean) {
            return new BooleanLiteral(object.toString());
        }

        if (object == null) {
            return new NullLiteral();
        }

        throw new UnsupportedOperationException("not yet implemented: " + object.getClass().getName());
    }
View Full Code Here

    @Override
    protected TypedByteCodeNode visitIfExpression(IfExpression node, CompilerContext context)
    {
        TypedByteCodeNode conditionValue = process(node.getCondition(), context);
        TypedByteCodeNode trueValue = process(node.getTrueValue(), context);
        TypedByteCodeNode falseValue = process(node.getFalseValue().or(new NullLiteral()), context);

        if (conditionValue.getType() == void.class) {
            return falseValue;
        }
        Preconditions.checkState(conditionValue.getType() == boolean.class);
View Full Code Here

        TypedByteCodeNode elseValue;
        if (node.getDefaultValue() != null) {
            elseValue = process(node.getDefaultValue(), context);
        }
        else {
            elseValue = process(new NullLiteral(), context);
        }

        List<TypedWhenClause> whenClauses = ImmutableList.copyOf(transform(node.getWhenClauses(), new Function<WhenClause, TypedWhenClause>()
        {
            @Override
View Full Code Here

        TypedByteCodeNode elseValue;
        if (node.getDefaultValue() != null) {
            elseValue = process(node.getDefaultValue(), context);
        }
        else {
            elseValue = process(new NullLiteral(), context);
        }
        List<TypedWhenClause> whenClauses = ImmutableList.copyOf(transform(node.getWhenClauses(), new Function<WhenClause, TypedWhenClause>()
        {
            @Override
            public TypedWhenClause apply(WhenClause whenClause)
View Full Code Here

            operands.add(process(expression, context));
        }

        Class<?> type = getType(operands);

        TypedByteCodeNode nullValue = coerceToType(context, process(new NullLiteral(), context), type);
        // reverse list because current if statement builder doesn't support if/else so we need to build the if statements bottom up
        for (TypedByteCodeNode operand : Lists.reverse(operands)) {
            Block condition = new Block(context)
                    .append(coerceToType(context, operand, type).getNode())
                    .getVariable("wasNull");
View Full Code Here

TOP

Related Classes of com.facebook.presto.sql.tree.NullLiteral

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.