Examples of BigDecimalColumnInterpreter


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();
    Double avg = null;
    avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(Double.NaN, avg, 0);
  }
View Full Code Here

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

  @Test
  public void testStdWithValidRange() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    double std = aClient.std(TEST_TABLE, ci, scan);
    assertEquals(5.766, std, 0.05d);
  }
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();
    double std = aClient.std(TEST_TABLE, ci, scan);
    assertEquals(2.87, std, 0.05d);
  }
View Full Code Here

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

  @Test
  public void testStdWithValidRangeWithNoCQ() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addFamily(TEST_FAMILY);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    double std = aClient.std(TEST_TABLE, ci, scan);
    assertEquals(6.342, std, 0.05d);
  }
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();
    double std = aClient.std(TEST_TABLE, ci, scan);
    System.out.println("std is:" + std);
    assertEquals(0, std, 0.05d);
  }
View Full Code Here

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

  public void testStdWithValidRangeWithNullCF() {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.setStartRow(ROWS[6]);
    scan.setStopRow(ROWS[17]);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    Double std = null;
    try {
      std = aClient.std(TEST_TABLE, ci, scan);
    } catch (Throwable e) {
    }
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[1]);
    final ColumnInterpreter<BigDecimal, BigDecimal> ci = new BigDecimalColumnInterpreter();
    Double std = null;
    try {
      std = aClient.std(TEST_TABLE, ci, scan);
    } catch (Throwable e) {
    }
View Full Code Here

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

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

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

  public void testMedianWithValidRange() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> 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

  public void testMaxWithValidRange() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> ci =
      new BigDecimalColumnInterpreter();
    BigDecimal maximum = aClient.max(TEST_TABLE, ci, scan);
    assertEquals(new BigDecimal("19.00"), maximum);
  }
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.