public static Constraints fromQueryMap(Schema schema, PartitionStrategy strategy, Map<String, String> query) { Map<String, Predicate> constraints = Maps.newLinkedHashMap(); Map<String, Object> provided = Maps.newHashMap(); for (Map.Entry<String, String> entry : query.entrySet()) { String name = entry.getKey(); if (SchemaUtil.isField(schema, strategy, name)) { Schema fieldSchema = SchemaUtil.fieldSchema(schema, strategy, name); Predicate predicate = Predicates.fromString( entry.getValue(), fieldSchema); constraints.put(name, predicate); if (predicate instanceof In) { Set values = Predicates.asSet((In) predicate); if (values.size() == 1) { provided.put(name, Iterables.getOnlyElement(values)); } } } } return new Constraints(schema, strategy, constraints, provided); }