private int executeFile(String fileName) {
    InputStream fileStream = null;
    try {
      if (!isBeeLine) {
        org.apache.hadoop.fs.Path path = new org.apache.hadoop.fs.Path(fileName);
        FileSystem fs;
        HiveConf conf = getCommands().getHiveConf(true);
        if (!path.toUri().isAbsolute()) {
          fs = FileSystem.getLocal(conf);
          path = fs.makeQualified(path);
        } else {
          fs = FileSystem.get(path.toUri(), conf);
        }
        fileStream = fs.open(path);
      } else {
        org.apache.hadoop.fs.Path path = new org.apache.hadoop.fs.Path(fileName);
        FileSystem fs;
        Configuration conf = new Configuration();
        if (!path.toUri().isAbsolute()) {
          fs = FileSystem.getLocal(conf);
          path = fs.makeQualified(path);
        } else {
          fs = FileSystem.get(path.toUri(), conf);
        }
        fileStream = fs.open(path);
      }
      return execute(initializeConsoleReader(fileStream), !getOpts().getForce());
    } catch (Throwable t) {
      handleException(t);
      return ERRNO_OTHER;
    } finally {
      IOUtils.closeStream(fileStream);
    }
  }
Start accepting input from stdin, and dispatch it
to the appropriate {@link CommandHandler} until the
global variable <code>exit</code> is true.
beeline/src/java/org/apache/hive/beeline/BeeLine.java