-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
See the reproducer in datafusion-cli (compiled from the latest main, commit 0242767)
> create table t1(v1 int);
0 row(s) fetched.
Elapsed 0.015 seconds.
> insert into t1 values (1);
+-------+
| count |
+-------+
| 1 |
+-------+
1 row(s) fetched.
Elapsed 0.017 seconds.
> SELECT LEAD(NULL, 1, false) OVER () FROM t1;
Arrow error: Cast error: Casting from Boolean to Null not supported
To Reproduce
No response
Expected behavior
This query should be valid, NULL literal can be interpreted as a missing bool value, so 1st and 3rd arg in lead() function have the same type
postgres result:
postgres=# create table t1(v1 int);
iCREATE TABLE
postgres=# insert into t1 values (1);
INSERT 0 1
postgres=# SELECT LEAD(NULL, 1, false) OVER () FROM t1;
lead
------
f
(1 row)
Additional context
Found by SQLancer #11030
findepi, jonathanc-n, comphead and jcsherin
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working