Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryIterator: wrapper for underlying ipc.Reader.Read() #64

Open
karel-rehor opened this issue Feb 22, 2024 · 0 comments
Open

QueryIterator: wrapper for underlying ipc.Reader.Read() #64

karel-rehor opened this issue Feb 22, 2024 · 0 comments
Assignees

Comments

@karel-rehor
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant