(array: &ArrayRef)
| 99 | } |
| 100 | |
| 101 | fn 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 | |
| 119 | fn spark_space_scalar(scalar: &ScalarValue) -> Result<ScalarValue> { |
| 120 | match scalar { |
no test coverage detected
searching dependent graphs…