fix: Issue #3784 pgjdbc can't decode numeric arrays containing special numbers like NaN#3838
Merged
davecramer merged 2 commits intopgjdbc:masterfrom Oct 31, 2025
Merged
fix: Issue #3784 pgjdbc can't decode numeric arrays containing special numbers like NaN#3838davecramer merged 2 commits intopgjdbc:masterfrom
davecramer merged 2 commits intopgjdbc:masterfrom
Conversation
…special numbers like NaN
Contributor
Author
|
cc @davecramer |
Contributor
Author
|
ping @davecramer |
bokken
reviewed
Nov 1, 2025
| } | ||
| }; | ||
|
|
||
| private static final ArrayDecoder<BigDecimal[]> BIG_DECIMAL_STRING_DECODER = new AbstractObjectStringArrayDecoder<BigDecimal[]>( |
Member
There was a problem hiding this comment.
This change seems non-passive. Am I missing something?
bokken
reviewed
Nov 1, 2025
| arr = rs.getArray(2); | ||
| assertEquals(Types.NUMERIC, arr.getBaseType()); | ||
| BigDecimal[] decarr = (BigDecimal[]) arr.getArray(); | ||
| Number[] decarr = (Number[]) arr.getArray(); |
Member
There was a problem hiding this comment.
Well there's no other way to represent NaN. It does pass all of our tests,
Do you want to revert this ?
Member
There was a problem hiding this comment.
It passes the tests after changing them.
The existing (unchanged) tests failed with a class cast exception.
I think it does need to be reverted.
We have discussed the lack of support for these special values in the past. It has been longstanding.
There are not great options.
1 would be a config for how to support/map numeric arrays.
2 would be to dynamically adjust the array type based on presence of these special values
Contributor
Author
9 tasks
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #3784