@VisibleForTesting
  public void compile(String command, boolean resetTaskIds, boolean deferClose) throws CommandProcessorException {
    prepareForCompile(resetTaskIds);

    Compiler compiler = new Compiler(context, driverContext, driverState);
    QueryPlan plan = compiler.compile(command, deferClose);
    driverContext.setPlan(plan);

    compileFinished(deferClose);
  }
Compiles an HQL command, creates an execution plan for it.

@param command  The HiveQL query to compile
@param resetTaskIds Resets taskID counter if true.
@param deferClose indicates if the close/destroy should be deferred when the process has been interrupted, it
       should be set to true if the compile is called within another method like runInternal, which defers the
       close to the called in that method.
ql/src/java/org/apache/hadoop/hive/ql/Driver.java