Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flink won't return first_value() of NULL #24

Open
nparrish42 opened this issue Dec 9, 2022 · 0 comments
Open

flink won't return first_value() of NULL #24

nparrish42 opened this issue Dec 9, 2022 · 0 comments
Assignees

Comments

@nparrish42
Copy link

checking this in as window_first_value.sql, but here's the simplest repro:

regression=# create table tiny (
regression(# id integer,
regression(#     a integer,
regression(#     b integer,
regression(#     c integer,
regression(#     PRIMARY KEY (id)
regression(# );
CREATE TABLE
regression=# insert into tiny values (1, 1, 1, NULL), (2, 1, 2, 66);
INSERT 0 2
regression=# select  a,
regression-#         b,
regression-#         c,
regression-#         first_value(c) over (partition by a order by b) as first_c
regression-# from tiny;
 a | b | c  | first_c
---+---+----+---------
 1 | 1 |    |
 1 | 2 | 66 |
(2 rows)
Flink SQL> select  a,
>         b,
>         c,
>         first_value(c) over (partition by a order by b) as first_c
> from tiny;
+----+-------------+-------------+-------------+-------------+
| op |           a |           b |           c |     first_c |
+----+-------------+-------------+-------------+-------------+
| +I |           1 |           2 |          66 |          66 |
| -D |           1 |           2 |          66 |          66 |
| +I |           1 |           1 |      <NULL> |      <NULL> |
| +I |           1 |           2 |          66 |          66 |
+----+-------------+-------------+-------------+-------------+
Received a total of 4 rows

first_c should always be NULL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants