private void writeAdditionalPayload(final DataOutputStream out) throws IOException {
    boolean isFileIdLong = fileKey instanceof Long, isFileIdWritable = fileKey instanceof Writable;
    int flags = (hasBase ? BASE_FLAG : 0) |
        (isOriginal ? ORIGINAL_FLAG : 0) |
        (hasFooter ? FOOTER_FLAG : 0) |
        (isFileIdLong ? HAS_LONG_FILEID_FLAG : 0) |
        (isFileIdWritable ? HAS_SYNTHETIC_FILEID_FLAG : 0) |
        (syntheticAcidProps != null? HAS_SYNTHETIC_ACID_PROPS_FLAG : 0);
    out.writeByte(flags);
    out.writeInt(deltas.size());
    for(AcidInputFormat.DeltaMetaData delta: deltas) {
      delta.write(out);
    }
    if (hasFooter) {
      OrcProto.FileTail fileTail = orcTail.getMinimalFileTail();
      byte[] tailBuffer = fileTail.toByteArray();
      int tailLen = tailBuffer.length;
      WritableUtils.writeVInt(out, tailLen);
      out.write(tailBuffer);
    }
    if (isFileIdLong) {
      out.writeLong(((Long)fileKey).longValue());
    } else if (isFileIdWritable) {
      ((Writable)fileKey).write(out);
    }
    out.writeLong(fileLen);
    out.writeUTF(rootDir.toString());
    if (syntheticAcidProps != null) {
      out.writeLong(syntheticAcidProps.rowIdOffset);
      out.writeInt(syntheticAcidProps.bucketProperty);
      out.writeLong(syntheticAcidProps.syntheticWriteId);
    }
  }
For every split we only want to keep the delete deltas, that contains files for that bucket.
If we filter out files, we might need to filter out statementIds from multistatement transactions.
@param dmd
@param bucketId
@return
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcSplit.java