use of com.linkedin.pinot.tools.data.generator.SchemaAnnotation in project pinot by linkedin.
the class GenerateDataCommand method buildCardinalityRangeMaps.
private void buildCardinalityRangeMaps(String file, HashMap<String, Integer> cardinality, HashMap<String, IntRange> range) throws JsonParseException, JsonMappingException, IOException {
List<SchemaAnnotation> saList;
if (file == null) {
// Nothing to do here.
return;
}
ObjectMapper objectMapper = new ObjectMapper();
saList = objectMapper.readValue(new File(file), new TypeReference<List<SchemaAnnotation>>() {
});
for (SchemaAnnotation sa : saList) {
String column = sa.getColumn();
if (sa.isRange()) {
range.put(column, new IntRange(sa.getRangeStart(), sa.getRangeEnd()));
} else {
cardinality.put(column, sa.getCardinality());
}
}
}
Aggregations