@Override
  public void close() {
    if (out != System.out && out != System.err) {
      //Don't close if system out or system err
      super.close();
    }
  }
The Session uses this stream instead of PrintStream to prevent closing of System out and System err.
Ref: HIVE-21033
common/src/java/org/apache/hadoop/hive/common/io/SessionStream.java