@Override
    public HiveBatchContext next() {
      try {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        HiveBatchContext batchContext = srcIterator.next();
        VectorizedRowBatch batch = batchContext.getBatch();

        int oldSize = batch.size;
        int newSize = 0;

        try (CloseableIterator<HiveRow> rowIterator = batchContext.rowIterator()) {
          deleteInputIterable.currentRowIterator = rowIterator;

          // Apply delete filtering and adjust the selected array so that undeleted row indices are filled with it.
          for (HiveRow row : deleteOutputIterable) {
            if (!row.isDeleted()) {
              batch.selected[newSize++] = row.physicalBatchIndex();
            }
          }
        }
        if (newSize < oldSize) {
          batch.size = newSize;
          batch.selectedInUse = true;
        }
        return batchContext;
      } catch (IOException e) {
        throw new UncheckedIOException(e);
      }
    }
Adjusts the pipeline of incoming VRBs so that for each batch every row goes through the delete filter.
@param batches iterable of HiveBatchContexts i.e. VRBs and their meta information
@return the adjusted iterable of HiveBatchContexts
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/vector/HiveDeleteFilter.java