code: @Override
      public Tuple getNext()
              throws IOException {
          Tuple tuple = null;
          try {
              if (isBuildingExample) {
                  isBuildingExample = false; // Terminate on the next iteration
                  return tupleFactory.newTuple(createPigExample());
              }
  
              boolean notDone = reader.nextKeyValue();
              if (!notDone) {
                  return null;
              }
  
              ParsedRecord value = reader.getCurrentValue();
  
              if (value != null) {
                  List<Object> values = new ArrayList<>();
                  if (onlyWantListOfFields) {
                      values.add(value.getString(ApacheHttpdLogfileRecordReader.FIELDS));
                  } else {
                      for (String fieldName : requestedFields) {
                          if (fieldName.endsWith(".*")) {
                              values.add(value.getStringSet(fieldName));
                              continue;
                          } else {
                              EnumSet<Casts> casts = reader.getParser().getCasts(fieldName);
  
                              if (casts != null) {
                                  if (casts.contains(Casts.LONG)) {
                                      values.add(value.getLong(fieldName));
                                      continue;
                                  }
  
                                  if (casts.contains(Casts.DOUBLE)) {
                                      values.add(value.getDouble(fieldName));
                                      continue;
                                  }
                              }
                          }
                          values.add(value.getString(fieldName));
                      }
                  }
                  tuple = tupleFactory.newTuple(values);
              }
          } catch (InvalidDissectorException | MissingDissectorsException e) {
              throw new IOException("Fatal error in the parser", e);
          }
          return tuple;
      }
docs: ------------------------------------------