Examples of ArithmeticExpression


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

            if (right == null) {
                return null;
            }

            if (hasUnresolvedValue(left, right)) {
                return new ArithmeticExpression(node.getType(), toExpression(left, expressionTypes.get(node.getLeft())), toExpression(right, expressionTypes.get(node.getRight())));
            }

            return invokeOperator(OperatorType.valueOf(node.getType().name()), types(node.getLeft(), node.getRight()), ImmutableList.of(left, right));
        }
View Full Code Here

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

        return expression;
    }

    public static ArithmeticExpression add(IdentityHashMap<Expression, Type> types, Expression left, Expression right)
    {
        ArithmeticExpression expression = new ArithmeticExpression(ADD, left, right);
        types.put(expression, BIGINT);
        return expression;
    }
View Full Code Here

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

        return expression;
    }

    public static ArithmeticExpression add(IdentityHashMap<Expression, Type> types, Expression left, Expression right)
    {
        ArithmeticExpression expression = new ArithmeticExpression(ADD, left, right);
        types.put(expression, BIGINT);
        return expression;
    }
View Full Code Here

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

            if (right == null) {
                return null;
            }

            if (hasUnresolvedValue(left, right)) {
                return new ArithmeticExpression(node.getType(), toExpression(left, expressionTypes.get(node.getLeft())), toExpression(right, expressionTypes.get(node.getRight())));
            }

            return invokeOperator(OperatorType.valueOf(node.getType().name()), types(node.getLeft(), node.getRight()), ImmutableList.of(left, right));
        }
View Full Code Here

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

                leftPlanBuilder.getRoot(),
                rightPlanBuilder.getRoot(),
                clauses.build());
        Optional<Symbol> sampleWeight = Optional.absent();
        if (leftPlanBuilder.getSampleWeight().isPresent() || rightPlanBuilder.getSampleWeight().isPresent()) {
            Expression expression = new ArithmeticExpression(ArithmeticExpression.Type.MULTIPLY, oneIfNull(leftPlanBuilder.getSampleWeight()), oneIfNull(rightPlanBuilder.getSampleWeight()));
            sampleWeight = Optional.of(symbolAllocator.newSymbol(expression, BIGINT));
            root = new ProjectNode(idAllocator.getNextId(), root, ImmutableMap.of(sampleWeight.get(), expression));
        }

        return new RelationPlan(root, outputDescriptor, outputSymbols, sampleWeight);
View Full Code Here

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

            if (right == null) {
                return null;
            }

            if (left instanceof Expression || right instanceof Expression) {
                return new ArithmeticExpression(node.getType(), toExpression(left), toExpression(right));
            }

            Number leftNumber = (Number) left;
            Number rightNumber = (Number) right;
            switch (node.getType()) {
View Full Code Here

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

                    ImmutableMap.Builder<Symbol, Expression> projections = ImmutableMap.builder();
                    Expression sampleWeightExpr;
                    switch (node.getType()) {
                        case INNER:
                        case CROSS:
                            sampleWeightExpr = new ArithmeticExpression(ArithmeticExpression.Type.MULTIPLY, new QualifiedNameReference(leftSampleWeight.toQualifiedName()), new QualifiedNameReference(rightSampleWeight.toQualifiedName()));
                            break;
                        case LEFT:
                            sampleWeightExpr = new ArithmeticExpression(ArithmeticExpression.Type.MULTIPLY, new QualifiedNameReference(leftSampleWeight.toQualifiedName()), oneIfNull(rightSampleWeight));
                            break;
                        case RIGHT:
                            sampleWeightExpr = new ArithmeticExpression(ArithmeticExpression.Type.MULTIPLY, oneIfNull(leftSampleWeight), new QualifiedNameReference(rightSampleWeight.toQualifiedName()));
                            break;
                        default:
                            throw new AssertionError(String.format("Unknown join type: %s", node.getType()));
                    }
                    outputSampleWeight = symbolAllocator.newSymbol(sampleWeightExpr, Type.BIGINT);
View Full Code Here

Examples of org.elegant.aash.comparator.parsing.expr.ArithmeticExpression

    } else if (stream.isEqualToIdentifier("in")) {
      cOp = 'E';
    }
    if (cOp != '\0') {
      Expression right = parseArithmeticExpression(stream);
      expr = new ArithmeticExpression(expr, cOp, right);
    }
    return expr;
  }
View Full Code Here

Examples of org.elegant.aash.comparator.parsing.expr.ArithmeticExpression

    Expression expr = parseMultExpression(stream);
    stream.ignoreBlanks();
    while (stream.lookAhead('+') || stream.lookAhead('-')) {
      char cOp = (char) stream.readChar();
      Expression right = parseMultExpression(stream);
      expr = new ArithmeticExpression(expr, cOp, right);
    }
    return expr;
  }
View Full Code Here

Examples of org.elegant.aash.comparator.parsing.expr.ArithmeticExpression

    Expression expr = parseLiteralExpression(stream);
    stream.ignoreBlanks();
    while (stream.lookAhead('*') || stream.lookAhead('/')) {
      char cOp = (char) stream.readChar();
      Expression right = parseLiteralExpression(stream);
      expr = new ArithmeticExpression(expr, cOp, right);
    }
    return expr;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.