MCPcopy Create free account
hub / github.com/apache/arrow-rs / new_unchecked

Method new_unchecked

arrow-data/src/data.rs:288–315  ·  view source on GitHub ↗

Create a new ArrayData instance; If `null_count` is not specified, the number of nulls in null_bit_buffer is calculated. If the number of nulls is 0 then the null_bit_buffer is set to `None`. # Safety The input values *must* form a valid Arrow array for `data_type`, or undefined behavior can result. Note: This is a low level API and most users of the arrow crate should create arrays using the

(
        data_type: DataType,
        len: usize,
        null_count: Option<usize>,
        null_bit_buffer: Option<Buffer>,
        offset: usize,
        buffers: Vec<Buffer>,
        child_data: 

Source from the content-addressed store, hash-verified

286 /// crate should create arrays using the methods in the `array`
287 /// module.
288 pub unsafe fn new_unchecked(
289 data_type: DataType,
290 len: usize,
291 null_count: Option<usize>,
292 null_bit_buffer: Option<Buffer>,
293 offset: usize,
294 buffers: Vec<Buffer>,
295 child_data: Vec<ArrayData>,
296 ) -> Self {
297 let mut skip_validation = UnsafeFlag::new();
298 // SAFETY: caller responsible for ensuring data is valid
299 unsafe { skip_validation.set(true) };
300
301 ArrayDataBuilder {
302 data_type,
303 len,
304 null_count,
305 null_bit_buffer,
306 nulls: None,
307 offset,
308 buffers,
309 child_data,
310 align_buffers: false,
311 skip_validation,
312 }
313 .build()
314 .unwrap()
315 }
316
317 /// Create a new ArrayData, validating that the provided buffers form a valid
318 /// Arrow array of the specified data type.

Callers

nothing calls this directly

Calls 2

setMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected