Examples of BigDecimalColumnInterpreter


Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

  @Test
  public void testMedianWithValidRange() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    BigDecimal median = aClient.median(TEST_TABLE, ci, scan);
    assertEquals(new BigDecimal("8.00"), median);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

  @Test
  public void testMax() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    BigDecimal maximum = aClient.max(TEST_TABLE, ci, scan);
    assertEquals(new BigDecimal("19.00"), maximum);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    scan.setStartRow(ROWS[5]);
    scan.setStopRow(ROWS[15]);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    BigDecimal max = aClient.max(TEST_TABLE, ci, scan);
    assertEquals(new BigDecimal("14.00"), max);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

  @Test
  public void testMaxWithValidRangeWithoutCQ() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addFamily(TEST_FAMILY);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    BigDecimal maximum = aClient.max(TEST_TABLE, ci, scan);
    assertEquals(new BigDecimal("19.00"), maximum);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addFamily(TEST_FAMILY);
    scan.setStartRow(ROWS[6]);
    scan.setStopRow(ROWS[7]);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    BigDecimal max = aClient.max(TEST_TABLE, ci, scan);
    assertEquals(new BigDecimal("6.00"), max);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

  }

  @Test
  public void testMaxWithValidRangeWithNullCF() {
    AggregationClient aClient = new AggregationClient(conf);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    Scan scan = new Scan();
    BigDecimal max = null;
    try {
      max = aClient.max(TEST_TABLE, ci, scan);
    } catch (Throwable e) {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

  }

  @Test
  public void testMaxWithInvalidRange() {
    AggregationClient aClient = new AggregationClient(conf);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    Scan scan = new Scan();
    scan.setStartRow(ROWS[4]);
    scan.setStopRow(ROWS[2]);
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    BigDecimal max = new BigDecimal(Long.MIN_VALUE);
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    scan.setStartRow(ROWS[4]);
    scan.setStopRow(ROWS[4]);
    try {
      AggregationClient aClient = new AggregationClient(conf);
      final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
      max = aClient.max(TEST_TABLE, ci, scan);
    } catch (Exception e) {
      max = BigDecimal.ZERO;
    }
    assertEquals(BigDecimal.ZERO, max);// control should go to the catch block
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    Filter f = new PrefixFilter(Bytes.toBytes("foo:bar"));
    scan.setFilter(f);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    max = aClient.max(TEST_TABLE, ci, scan);
    assertEquals(null, max);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter

    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    scan.setStartRow(HConstants.EMPTY_START_ROW);
    scan.setStopRow(HConstants.EMPTY_END_ROW);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    BigDecimal min = aClient.min(TEST_TABLE, ci, scan);
    assertEquals(new BigDecimal("0.00"), min);
  }
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.