private boolean isCommandUsedForTesting(final String command) {
    String commandName = command.trim().split("\\s+")[0];
    HiveCommand testCommand = HiveCommand.find(new String[]{ commandName }, HiveCommand.ONLY_FOR_TESTING);
    return testCommand != null;
  }
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