You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Omega359 (via GitHub)" <gi...@apache.org> on 2025/01/14 16:06:28 UTC

Re: [PR] fix: encode should work with non-UTF-8 binaries [datafusion]

Omega359 commented on code in PR #14087:
URL: https://github.com/apache/datafusion/pull/14087#discussion_r1915125736


##########
datafusion/functions/src/encoding/inner.rs:
##########
@@ -87,7 +87,20 @@ impl ScalarUDFImpl for EncodeFunc {
     }
 
     fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
-        Ok(arg_types[0].to_owned())
+        use DataType::*;
+
+        Ok(match arg_types[0] {
+            Utf8 => Utf8,

Review Comment:
   ```suggestion
               Utf8 => Utf8,
               Utf8View => Utf8,
   ```



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org