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

ARROW-16035: [Java] Handling empty JDBC ResultSet #13049

Conversation

toddfarmer
Copy link
Contributor

@toddfarmer toddfarmer commented May 2, 2022

ArrowVectorIterator.hasNext() delegates to the underlying resultset.isAfterLast() method, but per JDBC specs, this should return false in the case of empty ResultSets. This causes hasNext() to return true for empty ResultSets, triggering infinite loops.

@github-actions
Copy link

github-actions bot commented May 2, 2022

@github-actions
Copy link

github-actions bot commented May 2, 2022

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@toddfarmer toddfarmer changed the title ARROW-16035: Handling empty JDBC ResultSet ARROW-16035: [Java] Handling empty JDBC ResultSet May 2, 2022
@lidavidm lidavidm self-requested a review May 2, 2022 22:00
Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@lidavidm lidavidm closed this in 2025673 May 3, 2022
kszucs pushed a commit that referenced this pull request May 3, 2022
ArrowVectorIterator.hasNext() delegates to the underlying resultset.isAfterLast() method, but per JDBC specs, this [should return false in the case of empty ResultSets](https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/ResultSet.html#isAfterLast()).  This causes hasNext() to return true for empty ResultSets, triggering infinite loops.

Closes #13049 from toddfarmer/tofarmer/fix-hasnext-for-empty-resultset

Authored-by: Todd Farmer <todd@fivefarmers.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
@ursabot
Copy link

ursabot commented May 6, 2022

Benchmark runs are scheduled for baseline = cf2a35c and contender = 2025673. 2025673 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.74% ⬆️0.0%] test-mac-arm
[Finished ⬇️1.43% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.43% ⬆️0.04%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] 2025673f ec2-t3-xlarge-us-east-2
[Finished] 2025673f test-mac-arm
[Finished] 2025673f ursa-i9-9960x
[Finished] 2025673f ursa-thinkcentre-m75q
[Finished] cf2a35c0 ec2-t3-xlarge-us-east-2
[Finished] cf2a35c0 test-mac-arm
[Finished] cf2a35c0 ursa-i9-9960x
[Finished] cf2a35c0 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

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

Successfully merging this pull request may close these issues.

None yet

3 participants