You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
lag and lead window functions does not accept compatible default value #8307
The window functions lag and lead allow a default value as its third parameter.
Currently in DataFusion, this needs to be Int64 even though the value selected in the function is not of type Int64.
DataFusion CLI v33.0.0
❯ create table t1 (a timestamp);
0 rows in set. Query took 0.009 seconds.
❯ insert into t1 values (1),(2),(3);
+-------+
| count |
+-------+
| 3 |
+-------+
1 row in set. Query took 0.013 seconds.
❯ select lag(a, 1, '1970-01-01T00:00:00.000000001'::timestamp) OVER(ORDER BY a) from t1;
Internal error: Expects default value to have Int64 type.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
Expected behavior
Allow any default value that can be coerced into the first parameter
Activity
Allow default value on lag/lead if they are coerceable to value