private static float fieldSimilarity(Schema left, Schema right) { // check whether the unnamed records appear to be the same record Set<String> leftNames = names(left.getFields()); Set<String> rightNames = names(right.getFields()); int common = Sets.intersection(leftNames, rightNames).size(); float leftRatio = ((float) common) / ((float) leftNames.size()); float rightRatio = ((float) common) / ((float) rightNames.size()); return hmean(leftRatio, rightRatio); }