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/22 10:04:30 UTC

[I] [Bug] ArrowFormatCWriter will raise java.lang.IllegalArgumentException while writing arrow format with empty schema [paimon]

jichen20210919 opened a new issue, #6452:
URL: https://github.com/apache/paimon/issues/6452

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.
   
   
   ### Paimon version
   
   When we write rows to arrow format with empty paimon schema,following exception will raise
   `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)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)`
   
   ### Compute Engine
   
   JavaAPI
   
   ### Minimal reproduce step
   
           try (RootAllocator rootAllocator = new RootAllocator();
                   BufferAllocator allocator =
                           rootAllocator.newChildAllocator("paimonWriter", 0, Long.MAX_VALUE);
                   ArrowFormatCWriter writer =
                           new ArrowFormatCWriter(emptyschema, 4096, true, allocator)) {
               for (int i = 0; i < 100; i++) {
                   writer.write(GenericRow.of());
               }
               writer.flush();
               ArrowCStruct cStruct = writer.toCStruct();
               Assertions.assertThat(cStruct).isNotNull();
               writer.release();
           }
   
   ### What doesn't meet your expectations?
   
   It should work as normal.
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org