private BufferedReader getReaderFor(String filePath) throws HiveException {
    try {
      Path fullFilePath = FileSystems.getDefault().getPath(filePath);
      Path fileName = fullFilePath.getFileName();
      if (Files.exists(fileName)) {
        return Files.newBufferedReader(fileName, Charset.defaultCharset());
      }
      else
      if (Files.exists(fullFilePath)) {
        return Files.newBufferedReader(fullFilePath, Charset.defaultCharset());
      }
      else {
        throw new HiveException("Could not find \"" + fileName + "\" or \"" + fullFilePath + "\" in IN_FILE() UDF.");
      }
    }
    catch(IOException exception) {
      throw new HiveException(exception);
    }
  }
IN_FILE(str, filename) returns true if 'str' appears in the file specified
by 'filename'.  A string is considered to be in the file if it that string
appears as a line in the file.

If either argument is NULL then NULL is returned.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java