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

Function cast_numeric_to_binary

arrow-cast/src/cast/mod.rs:2542–2553  ·  view source on GitHub ↗
(
    array: &dyn Array,
)

Source from the content-addressed store, hash-verified

2540}
2541
2542fn cast_numeric_to_binary<FROM: ArrowPrimitiveType, O: OffsetSizeTrait>(
2543 array: &dyn Array,
2544) -> Result<ArrayRef, ArrowError> {
2545 let array = array.as_primitive::<FROM>();
2546 let size = std::mem::size_of::<FROM::Native>();
2547 let offsets = OffsetBuffer::from_repeated_length(size, array.len());
2548 Ok(Arc::new(GenericBinaryArray::<O>::try_new(
2549 offsets,
2550 array.values().inner().clone(),
2551 array.nulls().cloned(),
2552 )?))
2553}
2554
2555fn adjust_timestamp_to_timezone<T: ArrowTimestampType>(
2556 array: PrimitiveArray<Int64Type>,

Callers

nothing calls this directly

Calls 6

try_newFunction · 0.85
lenMethod · 0.45
cloneMethod · 0.45
innerMethod · 0.45
valuesMethod · 0.45
nullsMethod · 0.45

Tested by

no test coverage detected