lyne7-sc commented on code in PR #22905:
URL: https://github.com/apache/datafusion/pull/22905#discussion_r3436662898
##########
datafusion/functions/src/string/common.rs:
##########
@@ -402,11 +405,45 @@ fn case_conversion(
let result = a.as_ref().map(|x| unicode_case(x, lower));
Ok(ColumnarValue::Scalar(ScalarValue::Utf8View(result)))
}
+ ScalarValue::Dictionary(key_type, value) => {
+ let converted = case_conversion(
+ &[ColumnarValue::Scalar((**value).clone())],
+ lower,
+ name,
+ )?;
+ match converted {
+ ColumnarValue::Scalar(value) => Ok(ColumnarValue::Scalar(
+ ScalarValue::Dictionary(key_type.clone(),
Box::new(value)),
+ )),
+ ColumnarValue::Array(_) => {
+ unreachable!("scalar case conversion returned an
array")
+ }
Review Comment:
Nice suggestion, this looks much cleaner. I’ve updated it accordingly.
--
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]