public PrintStream getOutStream() {
      SessionState ss = SessionState.get();
      return ((ss != null) && (ss.out != null)) ? ss.out : System.out;
    }
Get the console output stream for HiveServer2 or HiveCli.
@return The output stream
ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java