ResultSet getTables() throws SQLException {
    if (!(assertConnection())) {
      return null;
    }
    return getDatabaseConnection().getDatabaseMetaData().getTables(
        getDatabaseConnection().getDatabaseMetaData().getConnection().getCatalog(), null, "%",
        new String[] {"TABLE"});
  }
Try to obtain the current size of the specified {@link ResultSet} by jumping to the last row
and getting the row number.

@param rs
         the {@link ResultSet} to get the size for
@return the size, or -1 if it could not be obtained
beeline/src/java/org/apache/hive/beeline/BeeLine.java