code: private static List<InputSplit> cleanSplits(List<InputSplit> splits) throws IOException {
      if (VersionInfo.getVersion().compareTo("2.3.0") >= 0) {
        // This issue was fixed in 2.3.0, if newer version, no need to clean up splits
        return splits;
      }
  
      List<InputSplit> cleanedSplits = Lists.newArrayList();
  
      for (int i = 0; i < splits.size(); i++) {
        CombineFileSplit oldSplit = (CombineFileSplit) splits.get(i);
        String[] locations = oldSplit.getLocations();
  
        Preconditions.checkNotNull(locations, "CombineFileSplit.getLocations() returned null");
  
        if (locations.length > SPLIT_MAX_NUM_LOCATIONS) {
          locations = Arrays.copyOf(locations, SPLIT_MAX_NUM_LOCATIONS);
        }
  
        cleanedSplits.add(new CombineFileSplit(oldSplit.getPaths(), oldSplit.getStartOffsets(), oldSplit.getLengths(),
            locations));
      }
      return cleanedSplits;
    }
docs: Set the number of locations in the split to SPLIT_MAX_NUM_LOCATIONS if it is larger than
  SPLIT_MAX_NUM_LOCATIONS (MAPREDUCE-5186).