alamb commented on code in PR #8308:
URL: https://github.com/apache/arrow-datafusion/pull/8308#discussion_r1412522516


##########
datafusion/physical-expr/src/window/lead_lag.rs:
##########
@@ -238,9 +238,8 @@ fn get_default_value(
 ) -> Result<ScalarValue> {
     if let Some(default_value) = default_value {
         let default_value_type = default_value.data_type();
-        if can_coerce_from(dtype, &default_value_type)
-            || (dtype.is_integer() && default_value_type.is_integer())
-        {
+
+        if comparison_coercion(&default_value_type, dtype).is_some() {

Review Comment:
   I think coercing during physical evaluation is too late in the process -- 
most other coercion happens in the analyze phase so that subsequent 
transformations / optimizations use the same rules.  
   
   Would it be possible to move this coercion earlier into 
   
   
https://github.com/apache/arrow-datafusion/blob/513fd052bdbf5c7a73de544a876961f780b90a92/datafusion/optimizer/src/analyzer/type_coercion.rs#L64-L63
   
   ?



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

Reply via email to