private void readAllDeleteEventsFromDeleteDeltas(OriginalWriteIdLoader writeIdLoader)
        throws IOException, DeleteEventsOverflowMemoryException {
      if (sortMerger == null || sortMerger.isEmpty()) {
        return; // trivial case, nothing to read.
      }

      // Initialize the rowId array when we have some delete events.
      rowIds = new long[testMode ? 1 : 10000];

      int index = 0;
      // We compress the owids into CompressedOwid data structure that records
      // the fromIndex(inclusive) and toIndex(exclusive) for each unique owid.
      while (!sortMerger.isEmpty()) {
        // The sortMerger is a heap data structure that stores a pair of
        // (deleteRecordKey, deleteReaderValue) at each node and is ordered by deleteRecordKey.
        // The deleteReaderValue is the actual wrapper class that has the reference to the
        // underlying delta file that is being read, and its corresponding deleteRecordKey
        // is the smallest record id for that file. In each iteration of this loop, we extract(poll)
        // the minimum deleteRecordKey pair. Once we have processed that deleteRecordKey, we
        // advance the pointer for the corresponding deleteReaderValue. If the underlying file
        // itself has no more records, then we remove that pair from the heap, or else we
        // add the updated pair back to the heap.
        Entry<DeleteRecordKey, DeleteReaderValue> entry = sortMerger.pollFirstEntry();
        DeleteRecordKey deleteRecordKey = entry.getKey();
        DeleteReaderValue deleteReaderValue = entry.getValue();
        checkSize(index);
        rowIds[index] = deleteRecordKey.rowId;
        writeIdLoader.add(index, deleteRecordKey);
        ++index;
        if (deleteReaderValue.next(deleteRecordKey)) {
          sortMerger.put(deleteRecordKey, deleteReaderValue);
        } else {
          deleteReaderValue.close(); // Exhausted reading all records, close the reader.
        }
      }
      writeIds = writeIdLoader.done(index);
      if (rowIds.length > index) {
        rowIds = Arrays.copyOf(rowIds, index);
      }
    }
This is not done quite right.  The intent of {@link CompressedOwid} is a hedge against
"delete from T" that generates a huge number of delete events possibly even 2G - max array
size.  (assuming no one txn inserts > 2G rows (in a bucket)).  As implemented, the algorithm
first loads all data into one array owid[] and rowIds[] which defeats the purpose.
In practice we should be filtering delete evens by min/max ROW_ID from the split.  The later
is also not yet implemented: HIVE-16812.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java