janosik47 commented on code in PR #37531:
URL: https://github.com/apache/arrow/pull/37531#discussion_r1315215866
##########
java/c/src/test/python/integration_tests.py:
##########
@@ -195,7 +196,18 @@ def test_list_array(self):
# disabled check_metadata since the list internal field name
("item")
# is not preserved during round trips (it becomes "$data$").
), check_metadata=False)
-
+
+ def test_empty_list_array(self):
+ with pa.BufferOutputStream() as bos:
+ schema = pa.schema([pa.field("f0", pa.list_(pa.int32()), True)])
+ with ipc.new_stream(bos, schema) as writer:
+ src = pa.RecordBatch.from_arrays([pa.array([[]])],
schema=schema)
+ writer.write(src)
+ with pa.input_stream(bos.getvalue()) as ios:
+ with ipc.open_stream(ios) as reader:
+ batch = reader.read_next_batch()
+
+ self.round_trip_record_batch(lambda: batch)
Review Comment:
This may look like an overkill, however I could not came with a better way
to create a c-data structure which represents a vector with NULL data buffer,
which is what this PR is targeting.
Making just a regular batch will create non empty buffers, which is not
going to test anything.
Using streams force to produce 'optimised' vector representation with NULL
data buffer.
Confirmed that the test fails with upstream and passes with this PR's change.
--
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]