This is an automated email from the ASF dual-hosted git repository.

gabotechs pushed a commit to branch gabotechs/add-utf8-as-unit16-bug-reproducer
in repository https://gitbox.apache.org/repos/asf/datafusion.git

commit 91aeda4f59cba0fbff245d52281be70a90e122d7
Author: Gabriel Musat Mestre <[email protected]>
AuthorDate: Thu May 28 11:50:20 2026 +0200

    Add bug reproducer
---
 .../src/simplify_expressions/simplify_exprs.rs     | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs 
b/datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs
index 3e495f5355..15c03af044 100644
--- a/datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs
+++ b/datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs
@@ -401,6 +401,29 @@ mod tests {
         Ok(())
     }
 
+    #[test]
+    #[ignore = "Fails with: Cannot cast string '2013-07-01' to value of UInt16 
type"]
+    fn test_simplify_filter_cast_string_literal_to_uint16() -> Result<()> {
+        let schema = Schema::new(vec![Field::new("event_date", 
DataType::UInt16, false)]);
+        let scan = table_scan(Some("test"), &schema, None)?
+            .build()
+            .expect("building scan");
+        let plan = LogicalPlanBuilder::from(scan)
+            .filter(col("event_date").gt_eq(Expr::Cast(Cast::new(
+                Box::new(lit("2013-07-01")),
+                DataType::UInt16,
+            ))))?
+            .build()?;
+
+        assert_optimized_plan_equal!(
+            plan,
+            @r#"
+        Filter: test.event_date >= CAST(Utf8("2013-07-01") AS UInt16)
+          TableScan: test
+        "#
+        )
+    }
+
     #[test]
     fn test_simplify_optimized_plan_with_or() -> Result<()> {
         let table_scan = test_table_scan();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to