Comparing the iterator with Java iterators I was bothered that there is now HasNext() method to peek as to whether it contained an empty result. This lead to inspecting the underlying ipc.Reader which has a Read() method returning rec, err and error can be EOF. It would be nice if QueryIterator simply wrapped this method in its own Read() method, without having to go directly to Raw().
Expected behavior
Would like to be able to detect empty response from the iterator before attempting iteration. For example in Java an iterator has a HasNext() method.
Actual behavior
Without using Raw(), currently just start with iterator.Next() without peeking first to see that the iterator response has any next record to get.
Using Raw().Read() returns rec, err and the err can be EOF which kind of provides the desired check. It would be nicer though to have Read()(record, err) as a direct Method of QueryIterator.
Use Case
Comparing the iterator with Java iterators I was bothered that there is now HasNext() method to peek as to whether it contained an empty result. This lead to inspecting the underlying ipc.Reader which has a Read() method returning rec, err and error can be EOF. It would be nice if QueryIterator simply wrapped this method in its own Read() method, without having to go directly to Raw().
Expected behavior
Would like to be able to detect empty response from the iterator before attempting iteration. For example in Java an iterator has a HasNext() method.
Actual behavior
Without using Raw(), currently just start with iterator.Next() without peeking first to see that the iterator response has any next record to get.
Using Raw().Read() returns rec, err and the err can be EOF which kind of provides the desired check. It would be nicer though to have Read()(record, err) as a direct Method of QueryIterator.
Additional info
No response