alamb commented on code in PR #7405:
URL: https://github.com/apache/arrow-rs/pull/7405#discussion_r2039676458
##########
arrow-array/src/record_batch.rs:
##########
@@ -240,6 +241,27 @@ impl RecordBatch {
Self::try_new_impl(schema, columns, &options)
}
+ /// Creates a `RecordBatch` from a schema and columns
+ ///
+ /// # Safety
+ ///
+ /// Expects the following:
+ ///
+ /// * `schema.fields.len() == columns.len()`
+ /// * `schema.fields[i].data_type() == columns[i].data_type()`
+ /// * `columns[i].len() == row_count`
Review Comment:
```suggestion
/// Creates a `RecordBatch` from a schema and columns, without
validation.
///
/// See [`Self::try_new`] for the checked version.
///
/// # Safety
///
/// Expects the following:
///
/// * `schema.fields.len() == columns.len()`
/// * `schema.fields[i].data_type() == columns[i].data_type()`
/// * `columns[i].len() == row_count`
///
/// Note: if the schema, does not match the underlying data exactly,
this can lead to undefined behavior
/// for example, via conversion to a `StructArray`, which in turn could
lead to incorrect access.
```
--
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]