alamb commented on code in PR #15361: URL: https://github.com/apache/datafusion/pull/15361#discussion_r2270340912
########## datafusion/functions/src/datetime/to_char.rs: ########## @@ -248,11 +250,17 @@ fn _to_char_scalar( )) } } else { + // if the data type was a Date32, formatting could have failed because the format string + // contained datetime specifiers, so we'll retry by casting the date array as a timestamp array + if data_type == &Date32 { + return to_char_scalar(expression.clone().cast_to(&Date64, None)?, format); Review Comment: this clone seems unecessary. I'll make a PR to try and avoid some clones as a follow up -- 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