private CommandProcessorResponse executeClientInternal(String commands) throws CommandProcessorException {
    List<String> cmds = CliDriver.splitSemiColon(commands);
    CommandProcessorResponse response = new CommandProcessorResponse();

    StringBuilder command = new StringBuilder();
    QTestSyntaxUtil qtsu = new QTestSyntaxUtil(this, conf, pd);
    qtsu.checkQFileSyntax(cmds);

    for (String oneCmd : cmds) {
      if (StringUtils.endsWith(oneCmd, "\\")) {
        command.append(StringUtils.chop(oneCmd) + "\\;");
        continue;
      } else {
        if (isHiveCommand(oneCmd)) {
          command.setLength(0);
        }
        command.append(oneCmd);
      }
      if (StringUtils.isBlank(command.toString())) {
        continue;
      }

      String strCommand = command.toString();
      try {
        if (isCommandUsedForTesting(strCommand)) {
          response = executeTestCommand(strCommand);
        } else {
          response = cliDriver.processLine(strCommand);
        }
      } catch (CommandProcessorException e) {
        if (!ignoreErrors()) {
          throw e;
        }
      }
      command.setLength(0);
    }
    if (SessionState.get() != null) {
      SessionState.get().setLastCommand(null);  // reset
    }
    return response;
  }
Clear out any side effects of running tests
itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java