Package com.facebook.presto.sql.planner

Examples of com.facebook.presto.sql.planner.SymbolResolver


        Expression parsedExpression = FunctionAssertions.createExpression(expression, METADATA, SYMBOL_TYPES);

        IdentityHashMap<Expression, Type> expressionTypes = getExpressionTypes(TEST_SESSION, METADATA, SQL_PARSER, SYMBOL_TYPES, parsedExpression);
        ExpressionInterpreter interpreter = expressionOptimizer(parsedExpression, METADATA, TEST_SESSION, expressionTypes);
        return interpreter.optimize(new SymbolResolver()
        {
            @Override
            public Object getValue(Symbol symbol)
            {
                switch (symbol.getName().toLowerCase()) {
View Full Code Here


         * Evaluates an expression's response to binding the specified input symbols to NULL
         */
        private Object nullInputEvaluator(final Collection<Symbol> nullSymbols, Expression expression)
        {
            return ExpressionInterpreter.expressionOptimizer(expression, metadata, session)
                    .optimize(new SymbolResolver()
                    {
                        @Override
                        public Object getValue(Symbol symbol)
                        {
                            return nullSymbols.contains(symbol) ? null : new QualifiedNameReference(symbol.toQualifiedName());
View Full Code Here

        // We use the optimizer to be able to produce a semantic exception if columns are referenced in the expression.
        // We can't do this with the interpreter yet because it's designed for the execution stage and has the wrong shape.
        // So, for now, we punt on supporting non-deterministic functions.
        ExpressionInterpreter samplePercentageEval = ExpressionInterpreter.expressionOptimizer(relation.getSamplePercentage(), metadata, session);

        Object samplePercentageObject = samplePercentageEval.optimize(new SymbolResolver()
        {
            @Override
            public Object getValue(Symbol symbol)
            {
                throw new SemanticException(NON_NUMERIC_SAMPLE_PERCENTAGE, relation.getSamplePercentage(), "Sample percentage cannot contain column references");
View Full Code Here

        // We use the optimizer to be able to produce a semantic exception if columns are referenced in the expression.
        // We can't do this with the interpreter yet because it's designed for the execution stage and has the wrong shape.
        // So, for now, we punt on supporting non-deterministic functions.
        ExpressionInterpreter samplePercentageEval = ExpressionInterpreter.expressionOptimizer(relation.getSamplePercentage(), metadata, session);

        Object samplePercentageObject = samplePercentageEval.optimize(new SymbolResolver()
        {
            @Override
            public Object getValue(Symbol symbol)
            {
                throw new SemanticException(NON_NUMERIC_SAMPLE_PERCENTAGE, relation.getSamplePercentage(), "Sample percentage cannot contain column references");
View Full Code Here

         * Evaluates an expression's response to binding the specified input symbols to NULL
         */
        private Object nullInputEvaluator(final Collection<Symbol> nullSymbols, Expression expression)
        {
            return ExpressionInterpreter.expressionOptimizer(expression, metadata, session)
                    .optimize(new SymbolResolver()
                    {
                        @Override
                        public Object getValue(Symbol symbol)
                        {
                            return nullSymbols.contains(symbol) ? null : new QualifiedNameReference(symbol.toQualifiedName());
View Full Code Here

        // We use the optimizer to be able to produce a semantic exception if columns are referenced in the expression.
        // We can't do this with the interpreter yet because it's designed for the execution stage and has the wrong shape.
        // So, for now, we punt on supporting non-deterministic functions.
        ExpressionInterpreter samplePercentageEval = ExpressionInterpreter.expressionOptimizer(relation.getSamplePercentage(), metadata, session);

        Object samplePercentageObject = samplePercentageEval.optimize(new SymbolResolver()
        {
            @Override
            public Object getValue(Symbol symbol)
            {
                throw new SemanticException(NON_NUMERIC_SAMPLE_PERCENTAGE, relation.getSamplePercentage(), "Sample percentage cannot contain column references");
View Full Code Here

         * Evaluates an expression's response to binding the specified input symbols to NULL
         */
        private Object nullInputEvaluator(final Collection<Symbol> nullSymbols, Expression expression)
        {
            return ExpressionInterpreter.expressionOptimizer(expression, metadata, session)
                    .optimize(new SymbolResolver()
                    {
                        @Override
                        public Object getValue(Symbol symbol)
                        {
                            return nullSymbols.contains(symbol) ? null : new QualifiedNameReference(symbol.toQualifiedName());
View Full Code Here

        // We use the optimizer to be able to produce a semantic exception if columns are referenced in the expression.
        // We can't do this with the interpreter yet because it's designed for the execution stage and has the wrong shape.
        // So, for now, we punt on supporting non-deterministic functions.
        ExpressionInterpreter samplePercentageEval = ExpressionInterpreter.expressionOptimizer(relation.getSamplePercentage(), metadata, session);

        Object samplePercentageObject = samplePercentageEval.optimize(new SymbolResolver()
        {
            @Override
            public Object getValue(Symbol symbol)
            {
                throw new SemanticException(NON_NUMERIC_SAMPLE_PERCENTAGE, relation.getSamplePercentage(), "Sample percentage cannot contain column references");
View Full Code Here

        // We use the optimizer to be able to produce a semantic exception if columns are referenced in the expression.
        // We can't do this with the interpreter yet because it's designed for the execution stage and has the wrong shape.
        // So, for now, we punt on supporting non-deterministic functions.
        ExpressionInterpreter samplePercentageEval = ExpressionInterpreter.expressionOptimizer(relation.getSamplePercentage(), metadata, session);

        Object samplePercentageObject = samplePercentageEval.optimize(new SymbolResolver()
        {
            @Override
            public Object getValue(Symbol symbol)
            {
                throw new SemanticException(NON_NUMERIC_SAMPLE_PERCENTAGE, relation.getSamplePercentage(), "Sample percentage cannot contain column references");
View Full Code Here

         * Evaluates an expression's response to binding the specified input symbols to NULL
         */
        private Object nullInputEvaluator(final Collection<Symbol> nullSymbols, Expression expression)
        {
            return ExpressionInterpreter.expressionOptimizer(expression, metadata, session)
                    .optimize(new SymbolResolver()
                    {
                        @Override
                        public Object getValue(Symbol symbol)
                        {
                            return nullSymbols.contains(symbol) ? null : new QualifiedNameReference(symbol.toQualifiedName());
View Full Code Here

TOP

Related Classes of com.facebook.presto.sql.planner.SymbolResolver

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.