Examples of BetweenExpression


Examples of org.apache.pig.Expression.BetweenExpression

                builder.startNot();
                builder.lessThan(getColumnName(lhs), getExpressionValue(rhs));
                builder.end();
                break;
            case OP_BETWEEN:
                BetweenExpression between = (BetweenExpression) rhs;
                builder.between(getColumnName(lhs), getSearchArgObjValue(between.getLower()),  getSearchArgObjValue(between.getUpper()));
            case OP_IN:
                InExpression in = (InExpression) rhs;
                builder.in(getColumnName(lhs), getSearchArgObjValues(in.getValues()).toArray());
            default:
                throw new RuntimeException("Unsupported binary expression type: " + expr.getOpType() + " in " + expr);
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.BetweenExpression

  }
 
  public void testBetween() {
    Parser<Expression> parser = ExpressionParser.between(NUMBER);
    assertParser(parser, "1 BETWEEN 0 and 2",
        new BetweenExpression(number(1), true, number(0), number(2)));
    assertParser(parser, "1 not between 2 and 0",
        new BetweenExpression(number(1), false, number(2), number(0)));
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.BetweenExpression

        new BinaryExpression(number(1), Op.IS, NullExpression.instance));
    assertParser(parser, "1 is not null",
        new BinaryExpression(number(1), Op.NOT, NullExpression.instance));
    assertParser(parser, "1 like 2", new LikeExpression(number(1), true, number(2), null));
    assertParser(parser, "1 BETWEEN 0 and 2",
        new BetweenExpression(number(1), true, number(0), number(2)));
    assertParser(parser, "1 not between 2 and 0",
        new BetweenExpression(number(1), false, number(2), number(0)));
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.BetweenExpression

  @Test
  public void testBetween() {
    Parser<Expression> parser = ExpressionParser.between(NUMBER);
    assertParser(parser, "1 BETWEEN 0 and 2",
        new BetweenExpression(number(1), true, number(0), number(2)));
    assertParser(parser, "1 not between 2 and 0",
        new BetweenExpression(number(1), false, number(2), number(0)));
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.BetweenExpression

        new BinaryExpression(number(1), Op.IS, NullExpression.instance));
    assertParser(parser, "1 is not null",
        new BinaryExpression(number(1), Op.NOT, NullExpression.instance));
    assertParser(parser, "1 like 2", new LikeExpression(number(1), true, number(2), null));
    assertParser(parser, "1 BETWEEN 0 and 2",
        new BetweenExpression(number(1), true, number(0), number(2)));
    assertParser(parser, "1 not between 2 and 0",
        new BetweenExpression(number(1), false, number(2), number(0)));
  }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.BetweenExpression

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      BetweenExpression expression = stateObject.getExpression();

      // Expression
      if (stateObject.hasStateObject()) {
        stateObject.getStateObject().accept(this);
        writer.append(SPACE);
      }

      // 'NOT
      if (stateObject.hasNot()) {
        appendIdentifier((expression != null) ? expression.getActualNotIdentifier() : NOT, NOT);
        writer.append(SPACE);
      }

      // 'BETWEEN'
      appendIdentifier((expression != null) ? expression.getActualBetweenIdentifier() : BETWEEN, BETWEEN);

      if (shouldOutput(expression) || expression.hasSpaceAfterBetween()) {
        writer.append(SPACE);
      }

      // Lower bound expression
      if (stateObject.hasLowerBound()) {
        stateObject.getLowerBound().accept(this);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterLowerBound()) {
        writer.append(SPACE);
      }

      // 'AND'
      if (shouldOutput(expression) || expression.hasAnd()) {
        appendIdentifier((expression != null) ? expression.getActualAndIdentifier() : AND, AND);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterAnd()) {
        writer.append(SPACE);
      }

      // Upper bound expression
      if (stateObject.hasUpperBound()) {
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.BetweenExpression

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      BetweenExpression expression = stateObject.getExpression();

      // Expression
      if (stateObject.hasStateObject()) {
        stateObject.getStateObject().accept(this);
        writer.append(SPACE);
      }

      // 'NOT
      if (stateObject.hasNot()) {
        appendIdentifier((expression != null) ? expression.getActualNotIdentifier() : NOT, NOT);
        writer.append(SPACE);
      }

      // 'BETWEEN'
      appendIdentifier((expression != null) ? expression.getActualBetweenIdentifier() : BETWEEN, BETWEEN);

      if (shouldOutput(expression) || expression.hasSpaceAfterBetween()) {
        writer.append(SPACE);
      }

      // Lower bound expression
      if (stateObject.hasLowerBound()) {
        stateObject.getLowerBound().accept(this);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterLowerBound()) {
        writer.append(SPACE);
      }

      // 'AND'
      if (shouldOutput(expression) || expression.hasAnd()) {
        appendIdentifier((expression != null) ? expression.getActualAndIdentifier() : AND, AND);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterAnd()) {
        writer.append(SPACE);
      }

      // Upper bound expression
      if (stateObject.hasUpperBound()) {
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.BetweenExpression

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      BetweenExpression expression = stateObject.getExpression();

      // Expression
      if (stateObject.hasStateObject()) {
        stateObject.getStateObject().accept(this);
        writer.append(SPACE);
      }

      // 'NOT
      if (stateObject.hasNot()) {
        appendIdentifier((expression != null) ? expression.getActualNotIdentifier() : NOT, NOT);
        writer.append(SPACE);
      }

      // 'BETWEEN'
      appendIdentifier((expression != null) ? expression.getActualBetweenIdentifier() : BETWEEN, BETWEEN);

      if (shouldOutput(expression) || expression.hasSpaceAfterBetween()) {
        writer.append(SPACE);
      }

      // Lower bound expression
      if (stateObject.hasLowerBound()) {
        stateObject.getLowerBound().accept(this);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterLowerBound()) {
        writer.append(SPACE);
      }

      // 'AND'
      if (shouldOutput(expression) || expression.hasAnd()) {
        appendIdentifier((expression != null) ? expression.getActualAndIdentifier() : AND, AND);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterAnd()) {
        writer.append(SPACE);
      }

      // Upper bound expression
      if (stateObject.hasUpperBound()) {
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.BetweenExpression

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      BetweenExpression expression = stateObject.getExpression();

      // Expression
      if (stateObject.hasStateObject()) {
        stateObject.getStateObject().accept(this);
        writer.append(SPACE);
      }

      // 'NOT
      if (stateObject.hasNot()) {
        appendIdentifier((expression != null) ? expression.getActualNotIdentifier() : NOT, NOT);
        writer.append(SPACE);
      }

      // 'BETWEEN'
      appendIdentifier((expression != null) ? expression.getActualBetweenIdentifier() : BETWEEN, BETWEEN);

      if (shouldOutput(expression) || expression.hasSpaceAfterBetween()) {
        writer.append(SPACE);
      }

      // Lower bound expression
      if (stateObject.hasLowerBound()) {
        stateObject.getLowerBound().accept(this);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterLowerBound()) {
        writer.append(SPACE);
      }

      // 'AND'
      if (shouldOutput(expression) || expression.hasAnd()) {
        appendIdentifier((expression != null) ? expression.getActualAndIdentifier() : AND, AND);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterAnd()) {
        writer.append(SPACE);
      }

      // Upper bound expression
      if (stateObject.hasUpperBound()) {
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.