Package plan_runner.expressions

Examples of plan_runner.expressions.ValueExpression


    final String fnName = function.getName();
    if (fnName.equalsIgnoreCase("EXTRACT_YEAR")) {
      if (numParams != 1)
        throw new RuntimeException("EXTRACT_YEAR function has exactly one parameter!");
      final ValueExpression expr = expressions.get(0);
      final ValueExpression ve = new IntegerYearFromDate(expr);
      _exprStack.push(ve);
    }
  }
View Full Code Here


    throw new UnsupportedOperationException("Not supported yet.");
  }

  @Override
  public void visit(LongValue lv) {
    final ValueExpression ve = new ValueSpecification(_lc, lv.getValue());
    _exprStack.push(ve);
  }
View Full Code Here

  @Override
  public void visit(Multiplication m) {
    visitBinaryOperation(m);

    final ValueExpression right = _exprStack.pop();
    final ValueExpression left = _exprStack.pop();

    final ValueExpression mult = new plan_runner.expressions.Multiplication(left, right);
    _exprStack.push(mult);
  }
View Full Code Here

    prnths.getExpression().accept(this);
  }

  @Override
  public void visit(StringValue sv) {
    final ValueExpression ve = new ValueSpecification(_sc, sv.getValue());
    _exprStack.push(ve);
  }
View Full Code Here

  @Override
  public void visit(Subtraction s) {
    visitBinaryOperation(s);

    final ValueExpression right = _exprStack.pop();
    final ValueExpression left = _exprStack.pop();

    final ValueExpression sub = new plan_runner.expressions.Subtraction(left, right);
    _exprStack.push(sub);
  }
View Full Code Here

  private void visitSideEquals(Expression ex) {
    try {
      _exprStack = new Stack<ValueExpression>();
      ex.accept(this);
      final ValueExpression ve = _exprStack.pop();
      _hashExpressions.add(ve);
    } catch (final NotFromMyBranchException exc) {
      // expression would not be added in the list
    }
  }
View Full Code Here

    // expr is changed in place, so that it does not contain synonims
    final int position = _nt.indexOf(_tupleSchema, expr);
    if (position != ParserUtil.NOT_FOUND) {
      // we found an expression already in the tuple schema
      final TypeConversion tc = _nt.getType(_tupleSchema, expr);
      final ValueExpression ve = new ColumnReference(tc, position,
          ParserUtil.getStringExpr(expr));
      pushToExprStack(ve);
      return true;
    } else
      return false;
View Full Code Here

    // but only for GroupByProjections as the top level method.
    // That is, we can safely assume StringConversion method.
    // Permanent fix is to create StringConversion over overallAggregation.
    final TypeConversion tc = _sc;

    final ValueExpression ve = new ColumnReference(tc, position,
        ParserUtil.getStringExpr(column));
    pushToExprStack(ve);
  }
View Full Code Here

      // parameters for COUNT are ignored, as explained in super
      final String fnName = function.getName();
      if (fnName.equalsIgnoreCase("SUM")) {
        recognized = isRecognized(function.getParameters());
        if (recognized) {
          final ValueExpression expr = popFromExprStack();
          createSum(expr, function.isDistinct());
        }
      } else if (fnName.equalsIgnoreCase("COUNT")) {
        final List<ValueExpression> expressions = new ArrayList<ValueExpression>();
View Full Code Here

   */
  @Override
  public void visit(Addition adtn) {
    visitBinaryOperation(adtn);

    final ValueExpression right = _exprStack.pop();
    final ValueExpression left = _exprStack.pop();

    final ValueExpression add = new plan_runner.expressions.Addition(left, right);
    _exprStack.push(add);
  }
View Full Code Here

TOP

Related Classes of plan_runner.expressions.ValueExpression

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.