Skip to content

Commit 4da5095

Browse files
committed
Review feedback
1 parent e2f5d8f commit 4da5095

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: arrow-array/src/record_batch.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ impl RecordBatch {
241241
Self::try_new_impl(schema, columns, &options)
242242
}
243243

244-
/// Creates a `RecordBatch` from a schema and columns
244+
/// Creates a `RecordBatch` from a schema and columns, without validation.
245+
///
246+
/// See [`Self::try_new`] for the checked version.
245247
///
246248
/// # Safety
247249
///
@@ -250,6 +252,10 @@ impl RecordBatch {
250252
/// * `schema.fields.len() == columns.len()`
251253
/// * `schema.fields[i].data_type() == columns[i].data_type()`
252254
/// * `columns[i].len() == row_count`
255+
///
256+
/// Note: if the schema does not match the underlying data exactly, it can lead to undefined
257+
/// behavior, for example, via conversion to a `StructArray`, which in turn could lead
258+
/// to incorrect access.
253259
pub unsafe fn new_unchecked(
254260
schema: SchemaRef,
255261
columns: Vec<Arc<dyn Array>>,

0 commit comments

Comments
 (0)