Package org.apache.hadoop.hive.ql.io.sarg

Examples of org.apache.hadoop.hive.ql.io.sarg.PredicateLeaf


                .setMinimum("a").setMaximum("b").build()).build()));
  }

  @Test
  public void testEquals() throws Exception {
    PredicateLeaf pred = TestSearchArgumentImpl.createPredicateLeaf
        (PredicateLeaf.Operator.EQUALS, PredicateLeaf.Type.INTEGER,
            "x", 15L, null);
    assertEquals(TruthValue.NO_NULL,
        RecordReaderImpl.evaluatePredicate(createIntStats(20L, 30L), pred));
    assertEquals(TruthValue.YES_NO_NULL,
View Full Code Here


        RecordReaderImpl.evaluatePredicate(createIntStats(15L, 15L), pred));
  }

  @Test
  public void testNullSafeEquals() throws Exception {
    PredicateLeaf pred = TestSearchArgumentImpl.createPredicateLeaf
        (PredicateLeaf.Operator.NULL_SAFE_EQUALS, PredicateLeaf.Type.INTEGER,
            "x", 15L, null);
    assertEquals(TruthValue.NO,
        RecordReaderImpl.evaluatePredicate(createIntStats(20L, 30L), pred));
    assertEquals(TruthValue.YES_NO,
View Full Code Here

        RecordReaderImpl.evaluatePredicate(createIntStats(15L, 15L), pred));
  }

  @Test
  public void testLessThan() throws Exception {
    PredicateLeaf lessThan = TestSearchArgumentImpl.createPredicateLeaf
        (PredicateLeaf.Operator.LESS_THAN, PredicateLeaf.Type.INTEGER,
            "x", 15L, null);
    assertEquals(TruthValue.NO_NULL,
        RecordReaderImpl.evaluatePredicate(createIntStats(20L, 30L), lessThan));
    assertEquals(TruthValue.NO_NULL,
View Full Code Here

        RecordReaderImpl.evaluatePredicate(createIntStats(0L, 10L), lessThan));
  }

  @Test
  public void testLessThanEquals() throws Exception {
    PredicateLeaf pred = TestSearchArgumentImpl.createPredicateLeaf
        (PredicateLeaf.Operator.LESS_THAN_EQUALS, PredicateLeaf.Type.INTEGER,
            "x", 15L, null);
    assertEquals(TruthValue.NO_NULL,
        RecordReaderImpl.evaluatePredicate(createIntStats(20L, 30L), pred));
    assertEquals(TruthValue.YES_NO_NULL,
View Full Code Here

  @Test
  public void testIn() throws Exception {
    List<Object> args = new ArrayList<Object>();
    args.add(10L);
    args.add(20L);
    PredicateLeaf pred = TestSearchArgumentImpl.createPredicateLeaf
        (PredicateLeaf.Operator.IN, PredicateLeaf.Type.INTEGER,
            "x", null, args);
    assertEquals(TruthValue.YES_NULL,
        RecordReaderImpl.evaluatePredicate(createIntStats(20L, 20L), pred));
    assertEquals(TruthValue.NO_NULL,
View Full Code Here

  @Test
  public void testBetween() throws Exception {
    List<Object> args = new ArrayList<Object>();
    args.add(10L);
    args.add(20L);
    PredicateLeaf pred = TestSearchArgumentImpl.createPredicateLeaf
        (PredicateLeaf.Operator.BETWEEN, PredicateLeaf.Type.INTEGER,
            "x", null, args);
    assertEquals(TruthValue.NO_NULL,
        RecordReaderImpl.evaluatePredicate(createIntStats(0L, 5L), pred));
    assertEquals(TruthValue.NO_NULL,
View Full Code Here

        RecordReaderImpl.evaluatePredicate(createIntStats(12L, 18L), pred));
  }

  @Test
  public void testIsNull() throws Exception {
    PredicateLeaf pred = TestSearchArgumentImpl.createPredicateLeaf
        (PredicateLeaf.Operator.IS_NULL, PredicateLeaf.Type.INTEGER,
            "x", null, null);
    assertEquals(TruthValue.YES_NO,
        RecordReaderImpl.evaluatePredicate(createIntStats(20L, 30L), pred));
  }
View Full Code Here

        .deserialize(createDecimalStats("111.1", "112.1"))));
  }

  @Test
  public void testPredEvalWithIntStats() throws Exception {
    PredicateLeaf pred = TestSearchArgumentImpl.createPredicateLeaf(
        PredicateLeaf.Operator.NULL_SAFE_EQUALS, PredicateLeaf.Type.INTEGER, "x", 15L, null);
    assertEquals(TruthValue.YES_NO,
        RecordReaderImpl.evaluatePredicate(createIntStats(10, 100), pred));

    pred = TestSearchArgumentImpl.createPredicateLeaf(PredicateLeaf.Operator.NULL_SAFE_EQUALS,
View Full Code Here

        RecordReaderImpl.evaluatePredicate(createIntStats(10, 100), pred));
  }

  @Test
  public void testPredEvalWithDoubleStats() throws Exception {
    PredicateLeaf pred = TestSearchArgumentImpl.createPredicateLeaf(
        PredicateLeaf.Operator.NULL_SAFE_EQUALS, PredicateLeaf.Type.INTEGER, "x", 15L, null);
    assertEquals(TruthValue.YES_NO,
        RecordReaderImpl.evaluatePredicate(createDoubleStats(10.0, 100.0), pred));

    pred = TestSearchArgumentImpl.createPredicateLeaf(PredicateLeaf.Operator.NULL_SAFE_EQUALS,
View Full Code Here

        RecordReaderImpl.evaluatePredicate(createDoubleStats(10.0, 100.0), pred));
  }

  @Test
  public void testPredEvalWithStringStats() throws Exception {
    PredicateLeaf pred = TestSearchArgumentImpl.createPredicateLeaf(
        PredicateLeaf.Operator.NULL_SAFE_EQUALS, PredicateLeaf.Type.INTEGER, "x", 100, null);
    assertEquals(TruthValue.YES_NO,
        RecordReaderImpl.evaluatePredicate(createStringStats("10", "1000"), pred));

    pred = TestSearchArgumentImpl.createPredicateLeaf(PredicateLeaf.Operator.NULL_SAFE_EQUALS,
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.io.sarg.PredicateLeaf

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.