private List<String> getCreateQueries(Table table, String tempTableBase, AcidDirectory dir,
      ValidWriteIdList writeIds, Path tmpTableResultLocation, Path tmpTableDeleteResultLocation) {
    List<String> queries = new ArrayList<>();
    // create delta temp table
    String tmpTableName = AcidUtils.DELTA_PREFIX + tempTableBase;
    queries.add(buildCreateTableQuery(table, tmpTableName, true, false, null));
    String alterQuery = buildAlterTableQuery(tmpTableName, dir, writeIds, false);
    if (!alterQuery.isEmpty()) {
      queries.add(alterQuery);
    }
    // create delta result temp table
    queries.add(buildCreateTableQuery(table, tmpTableName + "_result", false, true,
        tmpTableResultLocation.toString()));

    // create delete delta temp tables
    String tmpDeleteTableName = AcidUtils.DELETE_DELTA_PREFIX + tempTableBase;
    queries.add(buildCreateTableQuery(table, tmpDeleteTableName,  true, false, null));

    alterQuery = buildAlterTableQuery(tmpDeleteTableName, dir, writeIds, true);
    if (!alterQuery.isEmpty()) {
      queries.add(alterQuery);
    }
    // create delete delta result temp table
    queries.add(buildCreateTableQuery(table, tmpDeleteTableName + "_result",  false, true,
        tmpTableDeleteResultLocation.toString()));
    return queries;
  }
Get a list of create/alter table queries. These tables serves as temporary data source for query based
minor compaction. The following tables are created:
<ol>
  <li>tmpDelta, tmpDeleteDelta - temporary, external, partitioned table, having the schema of an ORC ACID file.
  Each partition corresponds to exactly one delta/delete-delta directory</li>
  <li>tmpDeltaResult, tmpDeleteDeltaResult - temporary table which stores the aggregated results of the minor
  compaction query</li>
</ol>
@param table the source table, where the compaction is running on
@param tempTableBase an unique identifier which is used to create delta/delete-delta temp tables
@param dir the directory, where the delta directories resides
@param writeIds list of valid write ids, used to filter out delta directories which are not relevant for compaction
@param tmpTableResultLocation result delta dir
@param tmpTableDeleteResultLocation result delete delta dir
@return list of create/alter queries, always non-null
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/MinorQueryCompactor.java