pepijnve commented on code in PR #17131: URL: https://github.com/apache/datafusion/pull/17131#discussion_r2271156842
########## datafusion/functions/src/string/chr.rs: ########## @@ -47,22 +47,14 @@ pub fn chr(args: &[ArrayRef]) -> Result<ArrayRef> { for integer in integer_array { match integer { Some(integer) => { - if integer == 0 { - return exec_err!("null character not permitted."); - } else if integer < 0 { - return exec_err!("negative input not permitted."); - } else { - match core::char::from_u32(integer as u32) { - Some(c) => { - builder.append_value(c.encode_utf8(&mut buf)); - } - None => { - return exec_err!( - "requested character too large for encoding." - ); - } + if integer >= 0 && integer <= u32::MAX as i64 { Review Comment: That's better indeed. Code adjusted. -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org