boolean isHiveCommand(String command) {
    String[] cmd = command.trim().split("\\s+");
    if (HiveCommand.find(cmd) != null) {
      return true;
    } else if (HiveCommand.find(cmd, HiveCommand.ONLY_FOR_TESTING) != null) {
      return true;
    } else {
      return false;
    }
  }
This allows a .q file to continue executing after a statement runs into an error which is convenient
if you want to use another hive cmd after the failure to sanity check the state of the system.
itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java