From 4d3ff7ee5e9fb428e5c54f3f6c62a902c42a5132 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Thu, 16 Jun 2022 13:40:12 +0000 Subject: [PATCH] Add more tests with window expressions --- ...xpressions_with_window_functions.reference | 26 +++++++++++++++++++ ...2316_expressions_with_window_functions.sql | 8 ++++++ 2 files changed, 34 insertions(+) diff --git a/tests/queries/0_stateless/02316_expressions_with_window_functions.reference b/tests/queries/0_stateless/02316_expressions_with_window_functions.reference index 1bf661f197b..2560e90408c 100644 --- a/tests/queries/0_stateless/02316_expressions_with_window_functions.reference +++ b/tests/queries/0_stateless/02316_expressions_with_window_functions.reference @@ -226,3 +226,29 @@ ORDER BY number ASC; 97 52 52 98 53 53 99 54 54 +SELECT sum(number) / sum(sum(number)) OVER (PARTITION BY (number % 10)) +FROM numbers(10000) +GROUP BY number % 10; +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +SELECT 1 + sum(number) / sum(sum(number)) OVER (PARTITION BY (number % 10)) +FROM numbers(10000) +GROUP BY number % 10; +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 diff --git a/tests/queries/0_stateless/02316_expressions_with_window_functions.sql b/tests/queries/0_stateless/02316_expressions_with_window_functions.sql index 9b4b448ad17..c3137ef3746 100644 --- a/tests/queries/0_stateless/02316_expressions_with_window_functions.sql +++ b/tests/queries/0_stateless/02316_expressions_with_window_functions.sql @@ -18,3 +18,11 @@ SELECT avg(number) OVER (PARTITION BY number % 10) FROM numbers(100) ORDER BY number ASC; + +SELECT sum(number) / sum(sum(number)) OVER (PARTITION BY (number % 10)) +FROM numbers(10000) +GROUP BY number % 10; + +SELECT 1 + sum(number) / sum(sum(number)) OVER (PARTITION BY (number % 10)) +FROM numbers(10000) +GROUP BY number % 10;