@Override
    public void afterCompile(QueryLifeTimeHookContext ctx, boolean hasError) {
      if (hasError) {
        Throwable throwable = ctx.getHookContext().getException();
        retryPossible = throwable != null && throwable instanceof ReCompileException;
        cboMsg = retryPossible ? ((ReCompileException) throwable).getCboMessage() : null;
        LOG.debug("Recompile check result {} with CBO message {}", retryPossible, cboMsg);
      } else {
        retryPossible = false;
      }
    }
Re-compiles the query without CBO
ql/src/java/org/apache/hadoop/hive/ql/reexec/ReCompileWithoutCBOPlugin.java