public boolean next()

in flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcFlightStreamResultSet.java [175:216]


  public boolean next() throws SQLException {
    if (currentVectorSchemaRoot == null) {
      return false;
    }
    while (true) {
      final boolean hasNext = super.next();
      final int maxRows = statement != null ? statement.getMaxRows() : 0;
      if (maxRows != 0 && this.getRow() > maxRows) {
        if (statement.isCloseOnCompletion()) {
          statement.close();
        }
        return false;
      }

      if (hasNext) {
        return true;
      }

      if (currentEndpointData != null) {
        currentEndpointData.getStream().getRoot().clear();
        if (currentEndpointData.getStream().next()) {
          populateDataForCurrentFlightStream();
          continue;
        }

        flightEndpointDataQueue.enqueue(currentEndpointData);
      }

      currentEndpointData = getNextEndpointStream(false);

      if (currentEndpointData != null) {
        populateDataForCurrentFlightStream();
        continue;
      }

      if (statement != null && statement.isCloseOnCompletion()) {
        statement.close();
      }

      return false;
    }
  }