Package org.kitesdk.data.hbase.avro

Examples of org.kitesdk.data.hbase.avro.GenericAvroDao


    checkScannerYieldValues(builder.build(), possibleValues);
  }

  @Test
  public void testPassOneRegexMatchFilter() throws Exception {
    BaseDao<GenericRecord> dao = new GenericAvroDao(tablePool, tableName,
        recordString);

    Set<String> possibleValues = new HashSet<String>();
    for (int i = 0; i < 10; i++) {
      possibleValues.add("field1_2" + Integer.toString(i));
    }

    for (int i = 0; i < 10; i++) {
      possibleValues.add("field1_5" + Integer.toString(i));
    }

    EntityScannerBuilder<GenericRecord> builder = dao.getScannerBuilder();
    builder.addFilter(new RegexEntityFilter(dao.getEntitySchema(), dao
        .getEntityMapper().getEntitySerDe(), "field1", "field1_2\\d"));
    builder.addFilter(new RegexEntityFilter(dao.getEntitySchema(), dao
        .getEntityMapper().getEntitySerDe(), "field1", "field1_5\\d"));
    builder.setPassAllFilters(false);
    checkScannerYieldValues(builder.build(), possibleValues);

  }
View Full Code Here

TOP

Related Classes of org.kitesdk.data.hbase.avro.GenericAvroDao

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.