alamb commented on code in PR #11968:
URL: https://github.com/apache/datafusion/pull/11968#discussion_r1717551300
##########
datafusion/functions/src/string/overlay.rs:
##########
@@ -76,54 +80,107 @@ impl ScalarUDFImpl for OverlayFunc {
fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue> {
match args[0].data_type() {
- DataType::Utf8 => make_scalar_function(overlay::<i32>,
vec![])(args),
+ DataType::Utf8View | DataType::Utf8 => {
+ make_scalar_function(overlay::<i32>, vec![])(args)
+ }
DataType::LargeUtf8 => make_scalar_function(overlay::<i64>,
vec![])(args),
other => exec_err!("Unsupported data type {other:?} for function
overlay"),
}
}
}
+macro_rules! process_overlay {
Review Comment:
It would be nice to have some sort of trait in arrow-rs that allowed us to
write this as a generic function
It actually does have
https://github.com/apache/arrow-rs/blob/2461a16c19ee5032531b1c05dd7e7192bc842e0f/arrow-string/src/like.rs#L158-L161
But that is not public
@XiangpengHao do you know of anything that is pub?
We could also implement such a trait for DataFusion's convenience, and then
propose upstreaming it 🤔
--
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]