boolean dispatch(String line) {
    if (line == null) {
      // exit
      exit = true;
      return true;
    }

    line = HiveStringUtils.removeComments(line);

    if (line.trim().length() == 0) {
      return true;
    }

    line = line.trim();

    // save it to the current script, if any
    if (scriptOutputFile != null) {
      scriptOutputFile.addLine(line);
    }

    if (isHelpRequest(line)) {
      line = "!help";
    }

    if (isBeeLine) {
      if (line.startsWith(COMMAND_PREFIX)) {
        // handle SQLLine command in beeline which starts with ! and does not end with ;
        return execCommandWithPrefix(line);
      } else {
        return commands.sql(line, getOpts().getEntireLineAsCommand());
      }
    } else {
      return commands.sql(line, getOpts().getEntireLineAsCommand());
    }
  }
Dispatch the specified line to the appropriate {@link CommandHandler}.

@param line
         the command-line to dispatch
@return true if the command was "successful"
beeline/src/java/org/apache/hive/beeline/BeeLine.java