You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "bodduv (via GitHub)" <gi...@apache.org> on 2025/03/27 12:00:57 UTC
[PR] Preserve nullability information while transfering DecimalVector and Decimal256Vector [arrow-java]
bodduv opened a new pull request, #693:
URL: https://github.com/apache/arrow-java/pull/693
## What's Changed
This PR proposes to use the "from" `ValueVector`'s field while transferring `DecimalVector` and `Decimal256Vector` to preserve nullability information. This is to have similar behavior with all the other primitive value vectors. Note that the `FieldType` of the value vector has nullability information.
Closes #692 .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-692: Preserve nullability information while transfering DecimalVector and Decimal256Vector [arrow-java]
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on code in PR #693:
URL: https://github.com/apache/arrow-java/pull/693#discussion_r2021087618
##########
vector/src/main/java/org/apache/arrow/vector/Decimal256Vector.java:
##########
@@ -566,9 +566,7 @@ private class TransferImpl implements TransferPair {
Decimal256Vector to;
public TransferImpl(String ref, BufferAllocator allocator) {
- to =
- new Decimal256Vector(
- ref, allocator, Decimal256Vector.this.precision, Decimal256Vector.this.scale);
+ to = new Decimal256Vector(ref, Decimal256Vector.this.field.getFieldType(), allocator);
Review Comment:
Shouldn't we test with `field`/`getFiedlType()` is not null and fallback to the vector precision if null ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-692: Preserve nullability information while transfering DecimalVector and Decimal256Vector [arrow-java]
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre merged PR #693:
URL: https://github.com/apache/arrow-java/pull/693
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-692: Preserve nullability information while transfering DecimalVector and Decimal256Vector [arrow-java]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #693:
URL: https://github.com/apache/arrow-java/pull/693#issuecomment-2757803347
<!-- label_helper_comment -->
Thank you for opening a pull request!
Please label the PR with one or more of:
- bug-fix
- chore
- dependencies
- documentation
- enhancement
Also, add the 'breaking-change' label if appropriate.
See [CONTRIBUTING.md](https://github.com/apache/arrow-java/blob/main/CONTRIBUTING.md) for details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-692: Preserve nullability information while transfering DecimalVector and Decimal256Vector [arrow-java]
Posted by "bodduv (via GitHub)" <gi...@apache.org>.
bodduv commented on PR #693:
URL: https://github.com/apache/arrow-java/pull/693#issuecomment-2757942858
Looks like the Dev PR Github workflow could not update milestone for the linked issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-692: Preserve nullability information while transfering DecimalVector and Decimal256Vector [arrow-java]
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on code in PR #693:
URL: https://github.com/apache/arrow-java/pull/693#discussion_r2021087618
##########
vector/src/main/java/org/apache/arrow/vector/Decimal256Vector.java:
##########
@@ -566,9 +566,7 @@ private class TransferImpl implements TransferPair {
Decimal256Vector to;
public TransferImpl(String ref, BufferAllocator allocator) {
- to =
- new Decimal256Vector(
- ref, allocator, Decimal256Vector.this.precision, Decimal256Vector.this.scale);
+ to = new Decimal256Vector(ref, Decimal256Vector.this.field.getFieldType(), allocator);
Review Comment:
Should we not test with `field`/`getFiedlType()` is not null and fallback to the vector precision if null ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-692: Preserve nullability information while transfering DecimalVector and Decimal256Vector [arrow-java]
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on code in PR #693:
URL: https://github.com/apache/arrow-java/pull/693#discussion_r2021088958
##########
vector/src/main/java/org/apache/arrow/vector/DecimalVector.java:
##########
@@ -564,8 +564,7 @@ private class TransferImpl implements TransferPair {
DecimalVector to;
public TransferImpl(String ref, BufferAllocator allocator) {
- to =
- new DecimalVector(ref, allocator, DecimalVector.this.precision, DecimalVector.this.scale);
+ to = new DecimalVector(ref, DecimalVector.this.field.getFieldType(), allocator);
Review Comment:
Same here. AFAIR, `field` and `getFieldType()` can be `null` (even if it should not happen, nothing prevent that in the code).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org