paleolimbot commented on issue #40898:
URL: https://github.com/apache/arrow/issues/40898#issuecomment-2033378565

   I am fairly sure that the problem is `NULL` buffers (not counting a missing 
validity buffer): after one is encountered, apparently csharp fails to release 
anything (?) (despite apparently computing equality without error). The change 
on the nanoarrow side that makes the integration tests pass is here: 
https://github.com/apache/arrow-nanoarrow/pull/399/commits/d455a1dd532ded88b3dae89675aa73bb657dde8b
   
   The bit of Python I ran to test that locally in details below.
   
   <details>
   
   ```python
   from archery.integration import cdata
   from archery.integration.tester_cpp import CppTester
   from archery.integration.tester_csharp import CSharpTester
   from archery.integration.tester_nanoarrow import NanoarrowTester
   
   with open("primitive-empty.json", "w") as f:
       f.write("""{
     "schema": {
       "fields": [
         {"name": "binary_nullable", "type": {"name": "binary"}, "nullable": 
true, "children": []}
       ]
     },
     "batches": [
       {
         "count": 0,
         "columns": [
           {"name": "binary_nullable", "count": 0, "VALIDITY": [], "OFFSET": 
[0], "DATA": []}
         ]
       }
     ]
   }""")
   
   tester_na = NanoarrowTester()
   tester_cs = CSharpTester()
   
   exporter = tester_na.make_c_data_exporter()
   importer = tester_cs.make_c_data_importer()
   
   json_path = "primitive-empty.json"
   ffi = cdata.ffi()
   
   c_array_ptr = ffi.new("struct ArrowArray*")
   
   with cdata.check_memory_released(exporter, importer):
       exporter.export_batch_from_json(json_path, 0, c_array_ptr)
       importer.import_batch_and_compare_to_json(json_path, 0, c_array_ptr)
   ```
   
   </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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to