You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "jichen20210919 (via GitHub)" <gi...@apache.org> on 2025/10/23 05:15:04 UTC
[PR] [arrow] Fix java.lang.IllegalArgumentException in ArrowFormatCWriter. [paimon]
jichen20210919 opened a new pull request, #6459:
URL: https://github.com/apache/paimon/pull/6459
…(#6452)
###Issue Description:
We have found following corner case for ArrowFormatCWriter, if Paimon schema has no fields, when we call method ArrowFormatCWriter.toCStruct, following exception will occur:
`java.lang.IllegalArgumentException
at org.apache.arrow.util.Preconditions.checkArgument(Preconditions.java:122)
at org.apache.arrow.vector.VectorSchemaRoot.getVector(VectorSchemaRoot.java:185)
at org.apache.paimon.arrow.ArrowUtils.serializeToCStruct(ArrowUtils.java:224)
at org.apache.paimon.arrow.vector.ArrowFormatCWriter.toCStruct(ArrowFormatCWriter.java:72)
at org.apache.paimon.arrow.vector.ArrowFormatWriterTest.testArrowFormatCWriterWithEmptySchema(ArrowFormatWriterTest.java:292)`
it is because following line in src/main/java/org/apache/paimon/arrow/ArrowUtils.java:L215
```
BufferAllocator bufferAllocator = vsr.getVector(0).getAllocator();
```
assume there are at least 1 fields in the vector schema root. We fix this by explicitly use bufferAllocator in realWriter object.
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
<!-- Linking this pull request to the issue -->
Linked issue: open #6452
<!-- What is the purpose of the change -->
Fix the java.lang.IllegalArgumentException
### Tests
<!-- List UT and IT cases to verify this change -->
ArrowFormatWriterTest.testArrowFormatCWriterWithEmptySchema
### API and Format
<!-- Does this change affect API or storage format -->
No
### Documentation
<!-- Does this change introduce a new feature -->
No
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [arrow] Fix java.lang.IllegalArgumentException in ArrowFormatCWriter. [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #6459:
URL: https://github.com/apache/paimon/pull/6459
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org