XiangpengHao commented on code in PR #11884:
URL: https://github.com/apache/datafusion/pull/11884#discussion_r1709516929
##########
datafusion/functions/src/string/ascii.rs:
##########
@@ -87,12 +69,92 @@ impl ScalarUDFImpl for AsciiFunc {
}
fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue> {
- match args[0].data_type() {
- DataType::Utf8 => make_scalar_function(ascii::<i32>, vec![])(args),
- DataType::LargeUtf8 => {
- return make_scalar_function(ascii::<i64>, vec![])(args);
- }
- _ => internal_err!("Unsupported data type"),
+ make_scalar_function(ascii, vec![])(args)
+ }
+}
+
+fn calculate_ascii<'a, I>(string_array: I) -> Result<ArrayRef>
+where
+ I: IntoIterator<Item = Option<&'a str>>,
Review Comment:
```suggestion
I: ArrayAccessor<Item = &'a str>,
```
As exampled in
https://github.com/apache/arrow-rs/blob/e28cf44e65cdd1fefaa1b857ca4336e7a9da5d06/arrow-array/src/array/mod.rs#L487-L507
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]