code: public String[] getMetaInfo(JavaRDD<String> fileRDD, String fieldSeparator) {
      String[] headers = null;
      int sampleSize = 5;
  
      // sanity check
      if (sampleSize < 1) {
        mLog.info("DATATYPE_SAMPLE_SIZE must be bigger than 1");
        return null;
      }
  
      List<String> sampleStr = fileRDD.take(sampleSize);
      sampleSize = sampleStr.size(); // actual sample size
      mLog.info("Sample size: " + sampleSize);
  
      // create sample list for getting data type
      String[] firstSplit = sampleStr.get(0).split(fieldSeparator);
  
      // get header
      boolean hasHeader = false;
      if (hasHeader) {
        headers = firstSplit;
      } else {
        headers = new String[firstSplit.length];
        int size = headers.length;
        for (int i = 0; i < size; ) {
          headers[i] = "V" + (++i);
        }
      }
  
      String[][] samples = hasHeader ? (new String[firstSplit.length][sampleSize - 1])
          : (new String[firstSplit.length][sampleSize]);
  
      String[] metaInfoArray = new String[firstSplit.length];
      int start = hasHeader ? 1 : 0;
      for (int j = start; j < sampleSize; j++) {
        firstSplit = sampleStr.get(j).split(fieldSeparator);
        for (int i = 0; i < firstSplit.length; i++) {
          samples[i][j - start] = firstSplit[i];
        }
      }
  
      boolean doPreferDouble = true;
      for (int i = 0; i < samples.length; i++) {
        String[] vector = samples[i];
        metaInfoArray[i] = headers[i] + " " + determineType(vector, doPreferDouble);
      }
  
      return metaInfoArray;
    }
docs: TODO: check more than a few lines in case some lines have NA
  
  @param fileRDD
  @return