Package com.facebook.presto.sql.tree

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


                new Function<Map.Entry<Symbol, Expression>, Expression>()
                {
                    @Override
                    public Expression apply(Map.Entry<Symbol, Expression> entry)
                    {
                        QualifiedNameReference reference = new QualifiedNameReference(entry.getKey().toQualifiedName());
                        Expression expression = entry.getValue();
                        return new ComparisonExpression(ComparisonExpression.Type.EQUAL, reference, expression);
                    }
                });
View Full Code Here


        Expression rightPredicate = node.getRight().accept(this, context);

        List<Expression> joinConjuncts = new ArrayList<>();
        for (JoinNode.EquiJoinClause clause : node.getCriteria()) {
            joinConjuncts.add(new ComparisonExpression(ComparisonExpression.Type.EQUAL,
                    new QualifiedNameReference(clause.getLeft().toQualifiedName()),
                    new QualifiedNameReference(clause.getRight().toQualifiedName())));
        }

        switch (node.getType()) {
            case INNER:
            case CROSS:
View Full Code Here

            Expression filterExpression = node.getPredicate();

            List<Expression> projectionExpressions = new ArrayList<>();
            for (int i = 0; i < node.getOutputSymbols().size(); i++) {
                Symbol symbol = node.getOutputSymbols().get(i);
                projectionExpressions.add(new QualifiedNameReference(symbol.toQualifiedName()));
            }

            List<Symbol> outputSymbols = node.getOutputSymbols();

            return visitScanFilterAndProject(context, sourceNode, filterExpression, projectionExpressions, outputSymbols);
View Full Code Here

            {
                // convert expression to qualified name reference (containing a symbol) if rewrite registered
                Expression rewrittenExpression;
                Symbol symbol = expressionMappings.get(node);
                if (symbol != null) {
                    rewrittenExpression = new QualifiedNameReference(symbol.toQualifiedName());
                }
                else {
                    rewrittenExpression = treeRewriter.defaultRewrite(node, context);
                }
View Full Code Here

        if (fieldOrExpression.isFieldReference()) {
            int fieldIndex = fieldOrExpression.getFieldIndex();
            Symbol symbol = fieldSymbols[fieldIndex];
            Preconditions.checkState(symbol != null, "No mapping for field '%s'", fieldIndex);

            return new QualifiedNameReference(symbol.toQualifiedName());
        }
        else {
            return rewrite(fieldOrExpression.getExpression());
        }
    }
View Full Code Here

    public void put(FieldOrExpression fieldOrExpression, Symbol symbol)
    {
        if (fieldOrExpression.isFieldReference()) {
            int fieldIndex = fieldOrExpression.getFieldIndex();
            fieldSymbols[fieldIndex] = symbol;
            expressionMappings.put(new QualifiedNameReference(rewriteBase.getSymbol(fieldIndex).toQualifiedName()), symbol);
        }
        else {
            put(fieldOrExpression.getExpression(), symbol);
        }
    }
View Full Code Here

                Preconditions.checkState(fieldIndex != null, "No field mapping for name '%s'", name);

                Symbol symbol = rewriteBase.getSymbol(fieldIndex);
                Preconditions.checkState(symbol != null, "No symbol mapping for name '%s' (%s)", name, fieldIndex);

                Expression rewrittenExpression = new QualifiedNameReference(symbol.toQualifiedName());

                // cast expression if coercion is registered
                Type coercion = analysis.getCoercion(node);
                if (coercion != null) {
                    rewrittenExpression = new Cast(rewrittenExpression, coercion.getName());
View Full Code Here

        ImmutableMap.Builder<Symbol, Expression> projections = ImmutableMap.builder();

        projections.putAll(coerce(uncoerced, subPlan, translations));

        for (Symbol symbol : alreadyCoerced) {
            projections.put(symbol, new QualifiedNameReference(symbol.toQualifiedName()));
        }

        return new PlanBuilder(translations, new ProjectNode(idAllocator.getNextId(), subPlan.getRoot(), projections.build()));
    }
View Full Code Here

        ImmutableMap.Builder<Symbol, Expression> projections = ImmutableMap.builder();

        // add an identity projection for underlying plan
        for (Symbol symbol : subPlan.getRoot().getOutputSymbols()) {
            Expression expression = new QualifiedNameReference(symbol.toQualifiedName());
            projections.put(symbol, expression);
        }

        ImmutableMap.Builder<Symbol, Expression> newTranslations = ImmutableMap.builder();
        for (Expression expression : expressions) {
View Full Code Here

        return new Function<Symbol, QualifiedNameReference>()
        {
            @Override
            public QualifiedNameReference apply(Symbol symbol)
            {
                return new QualifiedNameReference(symbol.toQualifiedName());
            }
        };
    }
View Full Code Here

TOP

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

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.