code: public static List<String> inferCategories(RecordReader recordReader,int columnIndex) {
          Set<String> categories = new HashSet<>();
          while(recordReader.hasNext()) {
              List<Writable> next = recordReader.next();
              categories.add(next.get(columnIndex).toString());
          }
  
          //Sort categories alphabetically - HashSet and RecordReader orders are not deterministic in general
          List<String> ret = new ArrayList<>(categories);
          Collections.sort(ret);
          return ret;
      }
docs: Infer the categories for the given record reader for a particular column
  Note that each "column index" is a column in the context of:
  List<Writable> record = ...;
  record.get(columnIndex);
  
  Note that anything passed in as a column will be automatically converted to a
  string for categorical purposes.
  
  The *expected* input is strings or numbers (which have sensible toString() representations)
  
  Note that the returned categories will be sorted alphabetically
  
  @param recordReader the record reader to iterate through
  @param columnIndex te column index to get categories for
  @return