Skip to content

Bug fix: The HasNext() function for Go driver arrow record iterator returning EOF for empty result set. #186

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

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

rcypher-databricks
Copy link
Contributor

@rcypher-databricks rcypher-databricks commented Jan 15, 2024

Bug fix: The HasNext() function for Go driver arrow record iterator returning EOF for empty result set.

Essentially, the HasNext() logic was assuming there were records in the result set in the case that the original return from executing the statement didn't specify, or if there were no direct results.

Updated arrowRecordIterator.HasNext() to check state of underlying iterators. This handles the case of direct results that contain no records.
Updated resultPageIterator.HasNext() to try fetching a result page if necessary to determine if there are more records.

Added tests for empty result sets with direct results enabled and disabled.
Internal ticket: ES-975398

…eturning EOF for empty resultset.

Essentially, the HasNext() logic was assuming there were records in the result set in the case that the original return from executing the statement didn't specify, or if there were direct results.

Updated arrowRecordIterator.HasNext() to check state of underlying iterators. This handles the case of direct results that contain no records.
Updated resultPageIterator.HasNext() to try fetching a result page if necessary to determine if there are more records.

Added tests for empty result sets with direct results enabled and disabled.

Signed-off-by: Raymond Cypher <[email protected]>
@rcypher-databricks rcypher-databricks merged commit 1f7f71d into databricks:main Jan 15, 2024
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

Successfully merging this pull request may close these issues.

2 participants