harsh-ande commented on code in PR #26127:
URL: https://github.com/apache/datafusion/pull/26127#discussion_r4366409179


##########
datafusion/spark/src/function/datetime/next_day.rs:
##########
@@ -41,8 +42,23 @@ impl Default for SparkNextDay {
 impl SparkNextDay {
     pub fn new() -> Self {
         Self {
-            signature: Signature::exact(
-                vec![DataType::Date32, DataType::Utf8],
+            // Spark casts the start date to DATE, so STRING and TIMESTAMP are 
accepted
+            signature: Signature::coercible(
+                vec![
+                    Coercion::new_implicit(
+                        TypeSignatureClass::Native(logical_date()),
+                        vec![
+                            TypeSignatureClass::Native(logical_string()),
+                            TypeSignatureClass::Timestamp,
+                        ],
+                        NativeType::Date,
+                    ),
+                    Coercion::new_implicit(
+                        TypeSignatureClass::Native(logical_string()),
+                        vec![TypeSignatureClass::Numeric],

Review Comment:
   Restored the previous weekday-to-string coercion using 
`TypeSignatureClass::Any` in this function’s signature. Added regression cases 
for Binary (`2015-07-27`) and Boolean (`NULL`). Shared coercion policy and the 
kernel are unchanged.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to