@Override
  protected void buildWhereClauseForInsert(StringBuilder query) {
    if (validWriteIdList != null) {
      long[] invalidWriteIds = validWriteIdList.getInvalidWriteIds();
      if (invalidWriteIds.length > 0) {
        query.append(" where `originalTransaction` not in (")
            .append(StringUtils.join(ArrayUtils.toObject(invalidWriteIds), ",")).append(")");
      }
    }
  }
Builds query strings that help with query-based MINOR compaction of CRUD.
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionQueryBuilderForMinor.java