andygrove commented on code in PR #552:
URL: https://github.com/apache/datafusion-comet/pull/552#discussion_r1634867061


##########
core/src/execution/datafusion/expressions/scalar_funcs/chr.rs:
##########
@@ -44,10 +44,18 @@ pub fn chr(args: &[ArrayRef]) -> Result<ArrayRef> {
         .iter()
         .map(|integer: Option<i64>| {
             integer
-                .map(|integer| match core::char::from_u32(integer as u32) {
-                    Some(integer) => Ok(integer.to_string()),
-                    None => {
-                        exec_err!("requested character too large for 
encoding.")
+                .map(|integer| {
+                    let adjusted_integer = if integer >= 0 { integer % 256 } 
else { integer };
+
+                    match core::char::from_u32(adjusted_integer as u32) {
+                        Some(integer) => Ok(integer.to_string()),

Review Comment:
   ```suggestion
                           Some(ch) => Ok(ch.to_string()),
   ```



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