ARROW-13792 [Java]: The toString representation is incorrect for unsigned integer vectors#11029
Closed
liyafan82 wants to merge 3 commits intoapache:masterfrom
Closed
ARROW-13792 [Java]: The toString representation is incorrect for unsigned integer vectors#11029liyafan82 wants to merge 3 commits intoapache:masterfrom
liyafan82 wants to merge 3 commits intoapache:masterfrom
Conversation
…gned integer vectors
emkornfield
reviewed
Aug 31, 2021
| public void testUInt2VectorToString() { | ||
| try (final UInt2Vector uInt2Vector = new UInt2Vector("uInt2Vector", allocator)) { | ||
| setVector(uInt2Vector, (char) 0xffff); | ||
| assertEquals("[" + new Character((char) 0xffff) + "]", uInt2Vector.toString()); |
Contributor
There was a problem hiding this comment.
lets use the exact string expected please.
Contributor
Author
There was a problem hiding this comment.
Thanks for your feedback. Revised accordingly.
Contributor
|
LGTM, one minor comment on the tests. |
emkornfield
reviewed
Aug 31, 2021
| public void testUInt2VectorToString() { | ||
| try (final UInt2Vector uInt2Vector = new UInt2Vector("uInt2Vector", allocator)) { | ||
| setVector(uInt2Vector, (char) 0xffff); | ||
| assertEquals("[\uffff]", uInt2Vector.toString()); |
Contributor
There was a problem hiding this comment.
actually, this doesn't look write. weshould convert this to the integer representation I think.
Contributor
Author
There was a problem hiding this comment.
I see your point. Please check if it looks right now?
Contributor
|
+1 thanks! |
ViniciusSouzaRoque
pushed a commit
to s1mbi0se/arrow
that referenced
this pull request
Oct 20, 2021
…gned integer vectors When adding a byte `0xff` to a UInt1Vector, the toString method produces `[-1]`. Since the vector contains unsinged integers, the correct result should be `[255]`. Closes apache#11029 from liyafan82/fly_0830_uin Authored-by: liyafan82 <[email protected]> Signed-off-by: Micah Kornfield <[email protected]>
pribor
pushed a commit
to GlobalWebIndex/arrow
that referenced
this pull request
Oct 24, 2025
…gned integer vectors When adding a byte `0xff` to a UInt1Vector, the toString method produces `[-1]`. Since the vector contains unsinged integers, the correct result should be `[255]`. Closes apache#11029 from liyafan82/fly_0830_uin Authored-by: liyafan82 <[email protected]> Signed-off-by: Micah Kornfield <[email protected]>
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.
When adding a byte
0xffto a UInt1Vector, the toString method produces[-1]. Since the vector contains unsinged integers, the correct result should be[255].