.requiredLong("created_at")
.requiredString("color")
.optionalInt("number")
.endRecord();
FieldPartitioner<Object, Integer> hash50 =
new HashFieldPartitioner("name", 50);
Constraints c = new Constraints(schema)
.with("number", 7, 14, 21, 28, 35, 42, 49)
.with("color", "green", "orange")
.from("created_at",
new DateTime(2013, 1, 1, 0, 0, DateTimeZone.UTC).getMillis())
.toBefore("created_at",
new DateTime(2014, 1, 1, 0, 0, DateTimeZone.UTC).getMillis());
PartitionStrategy strategy = new PartitionStrategy.Builder()
.hash("color", "hash", 50)
.year("created_at").month("created_at").day("created_at")
.identity("color")
.build();
StorageKey key = new StorageKey(strategy);
key.replaceValues(Lists.<Object>newArrayList(
hash50.apply("green"), 2013, 9, 1, "green"));
Assert.assertEquals(Sets.newHashSet("number"),
c.minimizeFor(key).keySet());
// adjust the end time so that month is the last field checked
Constraints c2 = c.toBefore("created_at",