String fieldName = entry.getKey(); FieldType fieldType = entry.getValue(); PartitionFilter.Condition<? extends Comparable> condition = filter.getCondition(fieldName); if (condition == null) { break; // this field is not present; we can't include any more fields in the start key
@Test public void testBuilderNullRange() { PartitionFilter filter = PartitionFilter.builder() .addValueCondition("a", 1) .<Long>addRangeCondition("x", null, null) .build(); Assert.assertEquals(1, filter.getConditions().size()); // only the one for "a" Assert.assertNull(filter.getCondition("x")); }
String fieldName = entry.getKey(); FieldType fieldType = entry.getValue(); PartitionFilter.Condition<? extends Comparable> condition = filter.getCondition(fieldName); if (condition == null) { break; // this field is not present; we can't include any more fields in the start key
String fieldName = entry.getKey(); FieldType fieldType = entry.getValue(); PartitionFilter.Condition<? extends Comparable> condition = filter.getCondition(fieldName); if (condition == null) { break; // this field is not present; we can't include any more fields in the stop key
String fieldName = entry.getKey(); FieldType fieldType = entry.getValue(); PartitionFilter.Condition<? extends Comparable> condition = filter.getCondition(fieldName); if (condition == null) { break; // this field is not present; we can't include any more fields in the stop key
private <T extends Comparable<T>> void validateCondition(PartitionFilter filter, String field, boolean single, Partitioning.FieldType type, T ... values) { PartitionFilter.Condition<? extends Comparable> condition = filter.getCondition(field); Assert.assertNotNull(condition); Assert.assertEquals(single, condition.isSingleValue()); type.validate(condition.getValue()); boolean expectMatch = true; for (T value : values) { if (value == null) { expectMatch = false; continue; } Assert.assertEquals(expectMatch, condition.match(value)); } }