@Override
  public void flush() throws IOException {
    initWriter();
    // streaming ingest writer with single transaction batch size, in which case the transaction is
    // either committed or aborted. In either cases we don't need flush length file but we need to
    // flush intermediate footer to reduce memory pressure. Also with HIVE-19206, streaming writer does
    // automatic memory management which would require flush of open files without actually closing it.
    if (flushLengths == null) {
      // transaction batch size = 1 case
      writer.writeIntermediateFooter();
    } else {
      // transaction batch size > 1 case
      long len = writer.writeIntermediateFooter();
      flushLengths.writeLong(len);
      OrcInputFormat.SHIMS.hflush(flushLengths);
    }
    bufferedRows = 0;
    //multiple transactions only happen for streaming ingest which only allows inserts
    assert deleteEventWriter == null : "unexpected delete writer for " + path;
  }
make sure bucketProperty in the delete event is from the {@link row} rather than whatever
{@link this#bucket} is.  For bucketed tables, the 2 must agree on bucketId encoded in it
not for necessarily the whole value.  For unbucketed tables there is no relationship.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java