alamb commented on code in PR #11967:
URL: https://github.com/apache/datafusion/pull/11967#discussion_r1715752731


##########
datafusion/functions/src/unicode/translate.rs:
##########
@@ -72,6 +75,7 @@ impl ScalarUDFImpl for TranslateFunc {
 
     fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue> {
         match args[0].data_type() {
+            DataType::Utf8View => make_scalar_function(translate::<i32>, 
vec![])(args),

Review Comment:
   I suspect this I think you'll likely also need to change the implementation 
of `translate` as well (see for example what @PsiACE  has done in 
https://github.com/apache/datafusion/pull/11970)



##########
datafusion/sqllogictest/test_files/string_view.slt:
##########
@@ -895,14 +895,13 @@ logical_plan
 02)--TableScan: test projection=[column1_utf8view, column2_utf8view]
 
 ## Ensure no casts for TRANSLATE
-## TODO file ticket
 query TT
 EXPLAIN SELECT
   TRANSLATE(column1_utf8view, 'foo', 'bar') as c
 FROM test;
 ----
 logical_plan
-01)Projection: translate(CAST(test.column1_utf8view AS Utf8), Utf8("foo"), 
Utf8("bar")) AS c
+01)Projection: translate(test.column1_utf8view, Utf8("foo"), Utf8("bar")) AS c

Review Comment:
   I think we should probably add a test that actually invokes the function 
with a `StringVieAwArray` argument.
   
   For example:
   
   ```
   SELECT
     TRANSLATE(column1_utf8view, 'foo', 'bar') as c
   ```
   
   



-- 
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]

Reply via email to