princejain756 opened a new pull request, #11845: URL: https://github.com/apache/arrow-rs/pull/11845
# Which issue does this PR close? - Closes #11833 # Rationale for this change `interleave_record_batch` read the schema from `record_batches[0]`, so calling it with no batches panicked with an index-out-of-bounds, and it built the result with `RecordBatch::try_new`, which rejects a batch with no columns and no explicit row count even though `indices.len()` provides one. # What changes are included in this PR? - Empty `record_batches` now returns `InvalidArgumentError`, matching the array-level `interleave`. - The result is built with `try_new_with_options` and `row_count = indices.len()`, so a column-less batch produces a batch with that many rows, matching `take_record_batch`. # Are these changes tested? Yes. Two tests in `interleave.rs`: empty input returns an `InvalidArgumentError`, and a 3-row schema-empty batch interleaved with `[(0, 0), (0, 2)]` yields a 2-row batch. Both fail on unmodified code (index panic and `InvalidArgumentError` respectively). -- 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]
