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

Function spark_space_array

datafusion/spark/src/function/string/space.rs:101–117  ·  view source on GitHub ↗
(array: &ArrayRef)

Source from the content-addressed store, hash-verified

99}
100
101fn spark_space_array(array: &ArrayRef) -> Result<ArrayRef> {
102 match array.data_type() {
103 DataType::Int32 => {
104 let array = as_int32_array(array)?;
105 Ok(Arc::new(spark_space_array_inner(array)))
106 }
107 DataType::Dictionary(_, _) => {
108 let dict = as_dictionary_array::<Int32Type>(array);
109 let values = spark_space_array(dict.values())?;
110 let result = DictionaryArray::try_new(dict.keys().clone(), values)?;
111 Ok(Arc::new(result))
112 }
113 other => {
114 exec_err!("Unsupported data type {other:?} for function `space`")
115 }
116 }
117}
118
119fn spark_space_scalar(scalar: &ScalarValue) -> Result<ScalarValue> {
120 match scalar {

Callers 1

spark_spaceFunction · 0.85

Calls 6

as_int32_arrayFunction · 0.85
newFunction · 0.85
spark_space_array_innerFunction · 0.85
data_typeMethod · 0.45
valuesMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…