MartinKolbAtWork commented on code in PR #12227: URL: https://github.com/apache/datafusion/pull/12227#discussion_r1738430697
########## datafusion/functions/src/datetime/to_date.rs: ########## @@ -118,3 +134,52 @@ impl ScalarUDFImpl for ToDateFunc { } } } + +#[cfg(test)] +mod tests { + use arrow::{compute::kernels::cast_utils::Parser, datatypes::Date32Type}; + use datafusion_common::ScalarValue; + use datafusion_expr::{ColumnarValue, ScalarUDFImpl}; + + use super::ToDateFunc; + + #[test] + fn test_year_9999() { + let date_str = "9999-12-31"; Review Comment: Thanks for the suggestions. I added tests for (almost) all the examples you mentioned. To make negative years work, I had to adapt the code, because currently negative years also do not work. I intentionally did not add support for 5-digit years, because not even the ISO 8601 standard supports them. -- 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