From 5d59001d44a77ac31fb3cb895c3b13233c3f8241 Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Fri, 22 Apr 2022 11:07:32 -0400 Subject: [PATCH] test is added --- tests/queries/0_stateless/02233_interpolate_1.reference | 6 ++++++ tests/queries/0_stateless/02233_interpolate_1.sql | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/tests/queries/0_stateless/02233_interpolate_1.reference b/tests/queries/0_stateless/02233_interpolate_1.reference index 64f5a8308bf..8eadd1a8d4e 100644 --- a/tests/queries/0_stateless/02233_interpolate_1.reference +++ b/tests/queries/0_stateless/02233_interpolate_1.reference @@ -238,3 +238,9 @@ original 7 10.5 \N 11 \N 11.5 \N +1 1 +2 2 +3 2 +4 3 +5 4 +6 3 diff --git a/tests/queries/0_stateless/02233_interpolate_1.sql b/tests/queries/0_stateless/02233_interpolate_1.sql index b11385e17b6..e2c6a456ec8 100644 --- a/tests/queries/0_stateless/02233_interpolate_1.sql +++ b/tests/queries/0_stateless/02233_interpolate_1.sql @@ -70,3 +70,10 @@ SELECT n, source, inter + NULL AS inter_p FROM ( SELECT n, source, inter AS inter_p FROM ( SELECT toFloat32(number % 10) AS n, 'original' AS source, number + NULL AS inter FROM numbers(10) WHERE (number % 3) = 1 ) ORDER BY n ASC WITH FILL FROM 0 TO 11.51 STEP 0.5 INTERPOLATE ( inter_p AS inter_p + 1 ); + +# Test INTERPOLATE for MergeTree +DROP TABLE IF EXISTS t_inter_02233; +CREATE TABLE t_inter_02233 (n Int32) ENGINE = MergeTree ORDER BY n; +INSERT INTO t_inter_02233 VALUES (1),(3),(3),(6),(6),(6); +SELECT n, count() AS m FROM t_inter_02233 GROUP BY n ORDER BY n WITH FILL INTERPOLATE ( m AS m + 1 ); +DROP TABLE IF EXISTS t_inter_02233; \ No newline at end of file