private Map<Path,Object> getPathMap(Path inputPath, Iterable<Row> resultSet) {
Map<Path,Object> pathMap = new HashMap<Path,Object>();
for (Row row : resultSet) {
String valueString = row.getString(valueColumnName);
Path path = DefaultPath.fromEncodedPathString(row.getString(pathColumnName));
if (!path.startsWith(inputPath)) {
throw new IllegalStateException("unexpected path found in database:" + path);
}
path = path.tail(inputPath.size());
Object value = StructureConverter.get().fromString(valueString);
// this can be a null converted from a JSON null
pathMap.put(path, value);
}
return pathMap;