westonpace opened a new issue, #35450:
URL: https://github.com/apache/arrow/issues/35450
### Describe the bug, including details regarding any error messages,
version, and platform.
I'm not entirely certain if it's legal for a record batch to be shorter than
its child arrays. However, if it is, then ToStructArray is not working
properly.
```
TEST_F(TestRecordBatch, SlicedToStructArray) {
std::shared_ptr<Array> x_arr = ArrayFromJSON(int64(), "[0, 1, 2, 3, 4, 5,
6, 7, 8, 9]");
auto batch = RecordBatch::Make(::arrow::schema({field("x", int64())}), 5,
{x_arr});
ASSERT_EQ(batch->num_rows(), 5); // This works
ASSERT_OK_AND_ASSIGN(auto struct_array, batch->ToStructArray());
ASSERT_EQ(struct_array->length(), 5); // This fails
}
```
### Component(s)
C++
--
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]