Exemplo n.º 1
0
 /**
  * Add an Inequality Filter to the Scanner, Will Filter Results Not Equal to the Filter Value
  *
  * @param fieldName The name of the column you want to apply the filter on
  * @param filterValue The value for comparison
  * @return ScannerBuilder
  */
 public EntityScannerBuilder<E> addNotEqualFilter(String fieldName, Object filterValue) {
   SingleFieldEntityFilter singleFieldEntityFilter =
       new SingleFieldEntityFilter(
           entityMapper.getEntitySchema(),
           entityMapper.getEntitySerDe(),
           fieldName,
           filterValue,
           CompareFilter.CompareOp.NOT_EQUAL);
   filterList.add(singleFieldEntityFilter.getFilter());
   return this;
 }
Exemplo n.º 2
0
 /**
  * Only include rows which are missing this field, this was the only possible way to do it.
  *
  * @param fieldName The field which should be missing
  * @return ScannerBuilder
  */
 public EntityScannerBuilder<E> addIsMissingFilter(String fieldName) {
   SingleFieldEntityFilter singleFieldEntityFilter =
       new SingleFieldEntityFilter(
           entityMapper.getEntitySchema(),
           entityMapper.getEntitySerDe(),
           fieldName,
           "++++NON_SHALL_PASS++++",
           CompareFilter.CompareOp.EQUAL);
   SingleColumnValueFilter filter = (SingleColumnValueFilter) singleFieldEntityFilter.getFilter();
   filter.setFilterIfMissing(false);
   filterList.add(filter);
   return this;
 }