Package com.facebook.presto.sql.tree

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


            QualifiedNameReference reference = extractReference(comparison);
            Symbol symbol = Symbol.fromQualifiedName(reference.getName());

            ConnectorColumnHandle column = symbolToColumnName.get(symbol);
            if (column != null) {
                Literal literal = extractLiteral(comparison);

                Object value;
                if (literal instanceof DoubleLiteral) {
                    value = ((DoubleLiteral) literal).getValue();
                }
                else if (literal instanceof LongLiteral) {
                    value = ((LongLiteral) literal).getValue();
                }
                else if (literal instanceof StringLiteral) {
                    value = ((StringLiteral) literal).getValue();
                }
                else if (literal instanceof BooleanLiteral) {
                    value = ((BooleanLiteral) literal).getValue();
                }
                else {
                    throw new AssertionError(String.format("Literal type (%s) not currently handled", literal.getClass().getName()));
                }

                // if there is a different constant value already bound for this column, the expression will always be false
                Object previous = bindings.get(column);
                if (previous != null && !previous.equals(value)) {
View Full Code Here


        {
            @Override
            protected Long visitComparisonExpression(ComparisonExpression node, Symbol rowNumberSymbol)
            {
                QualifiedNameReference reference = extractReference(node);
                Literal literal = extractLiteral(node);
                if (!Symbol.fromQualifiedName(reference.getName()).equals(rowNumberSymbol)) {
                    return null;
                }

                if (node.getLeft() instanceof QualifiedNameReference && node.getRight() instanceof Literal) {
View Full Code Here

        {
            @Override
            protected Long visitComparisonExpression(ComparisonExpression node, Symbol rowNumberSymbol)
            {
                QualifiedNameReference reference = extractReference(node);
                Literal literal = extractLiteral(node);
                if (!Symbol.fromQualifiedName(reference.getName()).equals(rowNumberSymbol)) {
                    return null;
                }

                if (node.getLeft() instanceof QualifiedNameReference && node.getRight() instanceof Literal) {
View Full Code Here

            QualifiedNameReference reference = extractReference(comparison);
            Symbol symbol = Symbol.fromQualifiedName(reference.getName());

            ColumnHandle column = symbolToColumnName.get(symbol);
            if (column != null) {
                Literal literal = extractLiteral(comparison);

                Object value;
                if (literal instanceof DoubleLiteral) {
                    value = ((DoubleLiteral) literal).getValue();
                }
                else if (literal instanceof LongLiteral) {
                    value = ((LongLiteral) literal).getValue();
                }
                else if (literal instanceof StringLiteral) {
                    value = ((StringLiteral) literal).getValue();
                }
                else if (literal instanceof BooleanLiteral) {
                    value = ((BooleanLiteral) literal).getValue();
                }
                else {
                    throw new AssertionError(String.format("Literal type (%s) not currently handled", literal.getClass().getName()));
                }

                // if there is a different constant value already bound for this column, the expression will always be false
                Object previous = bindings.get(column);
                if (previous != null && !previous.equals(value)) {
View Full Code Here

        {
            @Override
            protected Long visitComparisonExpression(ComparisonExpression node, Symbol rowNumberSymbol)
            {
                QualifiedNameReference reference = extractReference(node);
                Literal literal = extractLiteral(node);
                if (!Symbol.fromQualifiedName(reference.getName()).equals(rowNumberSymbol)) {
                    return null;
                }

                if (node.getLeft() instanceof QualifiedNameReference && node.getRight() instanceof Literal) {
View Full Code Here

TOP

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

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.