paleolimbot commented on code in PR #966:
URL: https://github.com/apache/arrow-nanoarrow/pull/966#discussion_r4296174546
##########
src/nanoarrow/ipc/writer_test.cc:
##########
@@ -726,3 +726,91 @@ TEST(NanoarrowIpcWriter, CompressedDictionaryStream) {
EXPECT_EQ(std::string(v0.data, v0.size_bytes), "foo");
EXPECT_EQ(std::string(v1.data, v1.size_bytes), "bar");
}
+
+TEST(NanoarrowIpcWriter, RoundtripEmptyArraysHaveZeroOffset) {
+ // nanoarrow's encoder writes a zero-length offsets buffer for an empty
array (as IPC
+ // permits). Decoded arrays must still export offsets[0] == 0 through the C
data
+ // interface, which carries no buffer sizes, whether or not the body is
shared.
+ struct ArrowError error;
Review Comment:
Probably this is more appropriate as a test for ArrowArrayFinalizeBuffers in
array_test.cc, although I get the motivating use case was IPC reads.
The IPC read case is I think better tested with a record batch bytes fixture
(you can construct the schema programmatically to save space).
--
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]