Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.2.5
Description
when you have a null in the value being windowed over this is being put at the end but the lead value is the first value in the window rather than null. I believe it should be null. If you don't have any nulls it behaves this way. This would also be a regression for columnstore 1.1.
Steps to repro:
create table t1(dt datetime);
|
insert into t1 values ('2017-05-17'), ('2017-05-18'), (null);
|
|
> select dt,lead(dt) over (order by dt) next from t1 where dt is not null;
|
+---------------------+---------------------+
|
| dt | next |
|
+---------------------+---------------------+
|
| 2017-05-17 00:00:00 | 2017-05-18 00:00:00 |
|
| 2017-05-18 00:00:00 | NULL |
|
+---------------------+---------------------+
|
2 rows in set (0.00 sec)
|
|
MariaDB [genesis]> select dt,lead(dt) over (order by dt) next from t1;
|
+---------------------+---------------------+
|
| dt | next |
|
+---------------------+---------------------+
|
| 2017-05-17 00:00:00 | 2017-05-18 00:00:00 |
|
| 2017-05-18 00:00:00 | NULL |
|
| NULL | 2017-05-17 00:00:00 |
|
+---------------------+---------------------+
|
3 rows in set (0.00 sec)
|
|
|