@Override
  public boolean hasNext() {
    if (endOfResult) {
      return false;
    }

    if (nextRow == null) {
      try {
        if (rs.next()) {
          nextRow = new Row(labelRow.sizes.length, rs);

          if (normalizingWidths) {
            // perform incremental normalization
            nextRow.sizes = labelRow.sizes;
          }
        } else {
          endOfResult = true;
        }
      } catch (SQLException ex) {
        throw new RuntimeException(ex.toString());
      }
    }
    return (nextRow != null);
  }
Rows implementation which returns rows incrementally from result set
without any buffering.
beeline/src/java/org/apache/hive/beeline/IncrementalRows.java