private File prepareExpectedOutputFile (String name, boolean comparePortable) throws IOException {
      if (!comparePortable) {
        return new File(resultsDirectory, name + ".q.out");
      } else {
        File rawExpectedOutputFile = new File(resultsDirectory, name + ".q.out");
        String rawOutput = FileUtils.readFileToString(rawExpectedOutputFile, "UTF-8");
        rawOutput = portableFilterSet.filter(rawOutput);
        File expectedOutputFile = new File(logDirectory, name + ".q.out.portable");
        FileUtils.writeStringToFile(expectedOutputFile, rawOutput);
        return expectedOutputFile;
      }
    }
Prepare the output file and apply the necessary filters on it.
@param name
@param comparePortable If this parameter is true, the commands, listed in the
COMMANDS_TO_REMOVE array will be filtered out in the output file.
@return The expected output file.
@throws IOException
itests/util/src/main/java/org/apache/hive/beeline/QFile.java