jayzhan211 commented on code in PR #8308:
URL: https://github.com/apache/arrow-datafusion/pull/8308#discussion_r1412124585
##########
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 thought you were just trying to deal with integer type. But, I think we
need to cover any compatible type 🤔 ?
If that is true, we should do `if let (coerced_type) =
comparison_coercion(&default_value_type, dtype)` and cast to coerced_type. Note
that coerced_type might not be the same as `default_value_type` or `dtype`.
If we just need to convert dtype to default_value_type, then
`can_coerce_from` is better.
--
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]