findepi commented on code in PR #12227:
URL: https://github.com/apache/datafusion/pull/12227#discussion_r1737211928


##########
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:
   this is a good date to test with
   
   can you also add a test with other interesting dates?
   
   - year 0001 (also common in some data, just like 9999)
   - a year before 1970 epoch
   - dates during julian/gregorian switch for some western countries 
(1582-10-10)
   - negative years -- these represent problems to some parsing libraries
   - 5+-digit year (after 9999) -- these represent problems to some parsing 
libraries



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

Reply via email to