MCPcopy Create free account
hub / github.com/apache/datafusion / unhex_scalar

Function unhex_scalar

datafusion/spark/src/function/math/unhex.rs:143–150  ·  view source on GitHub ↗

Convert a single hex string to binary

(s: &str)

Source from the content-addressed store, hash-verified

141
142/// Convert a single hex string to binary
143fn unhex_scalar(s: &str) -> Option<Vec<u8>> {
144 let mut buffer = Vec::with_capacity(s.len().div_ceil(2));
145 if unhex_common(s.as_bytes(), &mut buffer) {
146 Some(buffer)
147 } else {
148 None
149 }
150}
151
152fn spark_unhex(args: &[ColumnarValue]) -> Result<ColumnarValue, DataFusionError> {
153 let [args] = take_function_args("unhex", args)?;

Callers 1

spark_unhexFunction · 0.85

Calls 2

unhex_commonFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…