Skip to content

GH-734: Improve CompositeJdbcConsumer error handling and add unit tests#778

Open
Odin-BN wants to merge 1 commit into
apache:mainfrom
Odin-BN:fix-null-arrowtype-composite-jdbc-consumer
Open

GH-734: Improve CompositeJdbcConsumer error handling and add unit tests#778
Odin-BN wants to merge 1 commit into
apache:mainfrom
Odin-BN:fix-null-arrowtype-composite-jdbc-consumer

Conversation

@Odin-BN

@Odin-BN Odin-BN commented May 30, 2025

Copy link
Copy Markdown

What's Changed

This PR improves error handling in 'CompositeJdbConsumer' by safely handling null 'ValueVector' and 'ResultSet' values to prevent 'NullPointerException', and return the intended 'JdbcConsumerException'.

How was this tested?

Added two unit tests in 'CompositeJdbcConsumerTest':

  • 'testHandlesJdbcConsumerExceptionGracefully' verifies 'ArrowType' is captured if vector is valid, and returns the 'JdbcConsumerException' even though 'ResultSet' is null (which gave another NullPointerException previously).
  • 'testJdbcConsumerExceptionWhenArrowTypeIsNull' verifies 'ArrowType' is 'null' and returns the 'JdbcConsumerException'.

All tests pass after the change.

Closes #734

@github-actions

This comment has been minimized.

@Odin-BN

Odin-BN commented May 30, 2025

Copy link
Copy Markdown
Author

@github-actions please add label: bug-fix

@Odin-BN

Odin-BN commented May 30, 2025

Copy link
Copy Markdown
Author

Hi @lidavidm ! Would you mind adding the "bug-fix" label to this PR please?

I thought maybe the github actions bot could add it automatically with a message, as assigning the issue but it seems that not.

Thanks in advance!

@lidavidm lidavidm added the bug-fix PRs that fix a big. label Jun 2, 2025
@github-actions github-actions Bot added this to the 18.4.0 milestone Jun 2, 2025
@lidavidm

lidavidm commented Jun 2, 2025

Copy link
Copy Markdown
Member

Yeah, usually I label it when I review - maybe I should adjust it so that it's a reminder to reviewers (I originally thought the PR author could add labels...)

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure this addresses the original bug report, which is about when getType throws when we try to get arrowType. If anything, the right fix is to just get the type directly from the vector, rather than indirecting through getMinorType.

@jbonofre jbonofre modified the milestones: 19.0.0, 20.0.0 Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PRs that fix a big.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The real exception was swallowed by another exception in CompositeJdbcConsumer::consume

3 participants