pitrou commented on code in PR #46408:
URL: https://github.com/apache/arrow/pull/46408#discussion_r2110046285


##########
cpp/src/arrow/ipc/read_write_test.cc:
##########
@@ -579,6 +579,40 @@ TEST_F(TestIpcRoundTrip, SpecificMetadataVersion) {
   TestMetadataVersion(MetadataVersion::V5);
 }
 
+TEST_F(TestIpcRoundTrip, AlienSlice) {
+  // This tests serialization of a sliced ListArray that got sliced "the Rust
+  // way": by slicing the value_offsets buffer, but keeping top-level offset at
+  // 0.
+
+  // Values buffer [1, 2, 3, 4, 5]
+  TypedBufferBuilder<int32_t> values_builder;
+  ASSERT_OK(values_builder.Reserve(5));
+  for (int32_t i = 1; i <= 5; i++) {
+    ASSERT_OK(values_builder.Append(i));
+  }
+  ASSERT_OK_AND_ASSIGN(auto values_buffer, values_builder.Finish());

Review Comment:
   The `ArrayData` you get can be used directly as the list's child data.



-- 
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: github-unsubscr...@arrow.apache.org

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

Reply via email to