-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-13792 [Java]: The toString representation is incorrect for unsigned integer vectors #11029
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
Conversation
…gned integer vectors
| public void testUInt2VectorToString() { | ||
| try (final UInt2Vector uInt2Vector = new UInt2Vector("uInt2Vector", allocator)) { | ||
| setVector(uInt2Vector, (char) 0xffff); | ||
| assertEquals("[" + new Character((char) 0xffff) + "]", uInt2Vector.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets use the exact string expected please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback. Revised accordingly.
|
LGTM, one minor comment on the tests. |
| public void testUInt2VectorToString() { | ||
| try (final UInt2Vector uInt2Vector = new UInt2Vector("uInt2Vector", allocator)) { | ||
| setVector(uInt2Vector, (char) 0xffff); | ||
| assertEquals("[\uffff]", uInt2Vector.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, this doesn't look write. weshould convert this to the integer representation I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point. Please check if it looks right now?
|
+1 thanks! |
…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 <fan_li_ya@foxmail.com> Signed-off-by: Micah Kornfield <emkornfield@gmail.com>
…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 <fan_li_ya@foxmail.com> Signed-off-by: Micah Kornfield <emkornfield@gmail.com>
When adding a byte
0xffto a UInt1Vector, the toString method produces[-1]. Since the vector contains unsinged integers, the correct result should be[255].