private void forwardOutput(SplitResult splitResult) throws IOException, HiveException {
    for (Map.Entry<String, InputSplit> entry : transformSplitResult(splitResult).entrySet()) {
      Object[] os = new Object[2];
      os[0] = entry.getKey();
      InputSplit split = entry.getValue();
      bos.reset();
      split.write(dos);
      os[1] = bos.toByteArray();
      forward(os);
    }
  }
GenericUDTFGetSplits2 -  Memory efficient version of GenericUDTFGetSplits.
It separates out information like schema and planBytes[] which is common to all the splits.
This produces output in following format.
<p>
type                           split
----------------------------------------------------
schema-split             LlapInputSplit -- contains only schema
plan-split               LlapInputSplit -- contains only planBytes[]
0                        LlapInputSplit -- actual split 1
1                        LlapInputSplit -- actual split 2
...                         ...
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits2.java