mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Test with DESC order in sorting prefix
This commit is contained in:
parent
e1b00516c9
commit
d26f9e4022
@ -55,6 +55,8 @@ select * from ts order by sensor_id, timestamp with fill step 1 settings max_blo
|
||||
5 1 1
|
||||
5 2 0
|
||||
5 3 1
|
||||
-- FROM and TO
|
||||
-- ASC order in sorting prefix
|
||||
select * from ts order by sensor_id, timestamp with fill from 6 to 10 step 1 interpolate (value as 9999);
|
||||
1 6 9999
|
||||
1 7 9999
|
||||
@ -84,7 +86,37 @@ select * from ts order by sensor_id, timestamp with fill from 6 to 10 step 1 int
|
||||
3 7 1
|
||||
5 1 1
|
||||
5 3 1
|
||||
-- DESC order in sorting prefix
|
||||
select * from ts order by sensor_id DESC, timestamp with fill from 6 to 10 step 1 interpolate (value as 9999);
|
||||
5 1 1
|
||||
5 3 1
|
||||
5 6 9999
|
||||
5 7 9999
|
||||
5 8 9999
|
||||
5 9 9999
|
||||
3 5 1
|
||||
3 6 9999
|
||||
3 7 1
|
||||
3 8 9999
|
||||
3 9 9999
|
||||
1 6 9999
|
||||
1 7 9999
|
||||
1 8 9999
|
||||
1 9 9999
|
||||
1 10 1
|
||||
1 12 1
|
||||
select * from ts order by sensor_id DESC, timestamp with fill from 6 to 10 step 1 interpolate (value as 9999) settings use_with_fill_by_sorting_prefix=0;
|
||||
5 1 1
|
||||
5 3 1
|
||||
3 5 1
|
||||
0 6 9999
|
||||
3 7 1
|
||||
0 8 9999
|
||||
0 9 9999
|
||||
1 10 1
|
||||
1 12 1
|
||||
-- without TO
|
||||
-- ASC order in sorting prefix
|
||||
select * from ts order by sensor_id, timestamp with fill from 6 step 1 interpolate (value as 9999);
|
||||
1 6 9999
|
||||
1 7 9999
|
||||
@ -110,7 +142,33 @@ select * from ts order by sensor_id, timestamp with fill from 6 step 1 interpola
|
||||
3 7 1
|
||||
5 1 1
|
||||
5 3 1
|
||||
-- DESC order in sorting prefix
|
||||
select * from ts order by sensor_id DESC, timestamp with fill from 6 step 1 interpolate (value as 9999);
|
||||
5 1 1
|
||||
5 3 1
|
||||
3 5 1
|
||||
3 6 9999
|
||||
3 7 1
|
||||
1 6 9999
|
||||
1 7 9999
|
||||
1 8 9999
|
||||
1 9 9999
|
||||
1 10 1
|
||||
1 11 9999
|
||||
1 12 1
|
||||
select * from ts order by sensor_id DESC, timestamp with fill from 6 step 1 interpolate (value as 9999) settings use_with_fill_by_sorting_prefix=0;
|
||||
5 1 1
|
||||
5 3 1
|
||||
3 5 1
|
||||
0 6 9999
|
||||
3 7 1
|
||||
0 8 9999
|
||||
0 9 9999
|
||||
1 10 1
|
||||
0 11 9999
|
||||
1 12 1
|
||||
-- without FROM
|
||||
-- ASC order in sorting prefix
|
||||
select * from ts order by sensor_id, timestamp with fill to 10 step 1 interpolate (value as 9999);
|
||||
1 10 1
|
||||
1 12 1
|
||||
@ -135,5 +193,35 @@ select * from ts order by sensor_id, timestamp with fill to 10 step 1 interpolat
|
||||
3 7 1
|
||||
5 1 1
|
||||
5 3 1
|
||||
-- DESC order in sorting prefix
|
||||
select * from ts order by sensor_id DESC, timestamp with fill to 10 step 1 interpolate (value as 9999);
|
||||
5 1 1
|
||||
5 2 9999
|
||||
5 3 1
|
||||
5 4 9999
|
||||
5 5 9999
|
||||
5 6 9999
|
||||
5 7 9999
|
||||
5 8 9999
|
||||
5 9 9999
|
||||
3 5 1
|
||||
3 6 9999
|
||||
3 7 1
|
||||
3 8 9999
|
||||
3 9 9999
|
||||
1 10 1
|
||||
1 12 1
|
||||
select * from ts order by sensor_id DESC, timestamp with fill to 10 step 1 interpolate (value as 9999) settings use_with_fill_by_sorting_prefix=0;
|
||||
5 1 1
|
||||
0 2 9999
|
||||
5 3 1
|
||||
0 4 9999
|
||||
3 5 1
|
||||
0 6 9999
|
||||
3 7 1
|
||||
0 8 9999
|
||||
0 9 9999
|
||||
1 10 1
|
||||
1 12 1
|
||||
-- checking that sorting prefix columns can't be used in INTERPOLATE
|
||||
SELECT * FROM ts ORDER BY sensor_id, value, timestamp WITH FILL FROM 6 TO 10 INTERPOLATE ( value AS 1 ); -- { serverError INVALID_WITH_FILL_EXPRESSION }
|
||||
|
@ -31,16 +31,30 @@ insert into ts VALUES (1, 10, 1), (1, 12, 1), (3, 5, 1);
|
||||
insert into ts VALUES (3, 7, 1), (5, 1, 1), (5, 3, 1);
|
||||
select * from ts order by sensor_id, timestamp with fill step 1 settings max_block_size=3;
|
||||
|
||||
-- FROM and TO
|
||||
-- ASC order in sorting prefix
|
||||
select * from ts order by sensor_id, timestamp with fill from 6 to 10 step 1 interpolate (value as 9999);
|
||||
select * from ts order by sensor_id, timestamp with fill from 6 to 10 step 1 interpolate (value as 9999) settings use_with_fill_by_sorting_prefix=0;
|
||||
|
||||
-- DESC order in sorting prefix
|
||||
select * from ts order by sensor_id DESC, timestamp with fill from 6 to 10 step 1 interpolate (value as 9999);
|
||||
select * from ts order by sensor_id DESC, timestamp with fill from 6 to 10 step 1 interpolate (value as 9999) settings use_with_fill_by_sorting_prefix=0;
|
||||
|
||||
-- without TO
|
||||
-- ASC order in sorting prefix
|
||||
select * from ts order by sensor_id, timestamp with fill from 6 step 1 interpolate (value as 9999);
|
||||
select * from ts order by sensor_id, timestamp with fill from 6 step 1 interpolate (value as 9999) settings use_with_fill_by_sorting_prefix=0;
|
||||
-- DESC order in sorting prefix
|
||||
select * from ts order by sensor_id DESC, timestamp with fill from 6 step 1 interpolate (value as 9999);
|
||||
select * from ts order by sensor_id DESC, timestamp with fill from 6 step 1 interpolate (value as 9999) settings use_with_fill_by_sorting_prefix=0;
|
||||
|
||||
-- without FROM
|
||||
-- ASC order in sorting prefix
|
||||
select * from ts order by sensor_id, timestamp with fill to 10 step 1 interpolate (value as 9999);
|
||||
select * from ts order by sensor_id, timestamp with fill to 10 step 1 interpolate (value as 9999) settings use_with_fill_by_sorting_prefix=0;
|
||||
-- DESC order in sorting prefix
|
||||
select * from ts order by sensor_id DESC, timestamp with fill to 10 step 1 interpolate (value as 9999);
|
||||
select * from ts order by sensor_id DESC, timestamp with fill to 10 step 1 interpolate (value as 9999) settings use_with_fill_by_sorting_prefix=0;
|
||||
|
||||
-- checking that sorting prefix columns can't be used in INTERPOLATE
|
||||
SELECT * FROM ts ORDER BY sensor_id, value, timestamp WITH FILL FROM 6 TO 10 INTERPOLATE ( value AS 1 ); -- { serverError INVALID_WITH_FILL_EXPRESSION }
|
||||
|
Loading…
Reference in New Issue
Block a user