comphead commented on code in PR #8989:
URL: https://github.com/apache/arrow-datafusion/pull/8989#discussion_r1465748025


##########
datafusion/physical-expr/src/window/lead_lag.rs:
##########
@@ -236,14 +237,16 @@ fn get_default_value(
     default_value: Option<&ScalarValue>,
     dtype: &DataType,
 ) -> Result<ScalarValue> {
-    if let Some(value) = default_value {
-        if let ScalarValue::Int64(Some(val)) = value {
-            ScalarValue::try_from_string(val.to_string(), dtype)
-        } else {
-            internal_err!("Expects default value to have Int64 type")
+    match default_value {
+        Some(v) if v.data_type() == DataType::Int64 => {
+            ScalarValue::try_from_string(v.to_string(), dtype)

Review Comment:
   what was the point to cast through the string? Prob we can improve that 
later 



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