From bc4e08662d15c2048535b3c23a33e1e8f80b7898 Mon Sep 17 00:00:00 2001 From: Denny Crane Date: Fri, 16 Sep 2022 19:54:40 -0300 Subject: [PATCH] test for #41394 --- .../queries/0_stateless/01655_window_functions_bug.reference | 3 +++ tests/queries/0_stateless/01655_window_functions_bug.sql | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 tests/queries/0_stateless/01655_window_functions_bug.reference create mode 100644 tests/queries/0_stateless/01655_window_functions_bug.sql diff --git a/tests/queries/0_stateless/01655_window_functions_bug.reference b/tests/queries/0_stateless/01655_window_functions_bug.reference new file mode 100644 index 00000000000..2d44832e1f5 --- /dev/null +++ b/tests/queries/0_stateless/01655_window_functions_bug.reference @@ -0,0 +1,3 @@ +0 1 +-2 2 +-2 2 diff --git a/tests/queries/0_stateless/01655_window_functions_bug.sql b/tests/queries/0_stateless/01655_window_functions_bug.sql new file mode 100644 index 00000000000..8d0b2fc62e5 --- /dev/null +++ b/tests/queries/0_stateless/01655_window_functions_bug.sql @@ -0,0 +1,5 @@ +SELECT round((countIf(rating = 5)) - (countIf(rating < 5)), 4) as nps, + dense_rank() OVER (ORDER BY nps DESC) as rank +FROM (select number as rating, number%3 rest_id from numbers(10)) +group by rest_id +order by rank;