mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 01:00:48 +00:00
CURRENT ROW frame start for ROWS frame
This commit is contained in:
parent
ef46c36317
commit
78a9624fc5
@ -285,6 +285,19 @@ void WindowTransform::advanceFrameStartChoose()
|
||||
// the new partition starts.
|
||||
frame_started = true;
|
||||
return;
|
||||
case WindowFrame::BoundaryType::Current:
|
||||
switch (window_description.frame.type)
|
||||
{
|
||||
case WindowFrame::FrameType::Rows:
|
||||
// CURRENT ROW
|
||||
frame_start = current_row;
|
||||
frame_started = true;
|
||||
return;
|
||||
default:
|
||||
// Fallthrough to the "not implemented" error.
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case WindowFrame::BoundaryType::Offset:
|
||||
switch (window_description.frame.type)
|
||||
{
|
||||
@ -296,9 +309,6 @@ void WindowTransform::advanceFrameStartChoose()
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Fallthrough to the "not implemented" error.
|
||||
break;
|
||||
}
|
||||
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED,
|
||||
|
@ -516,7 +516,7 @@ settings max_block_size = 2;
|
||||
27 27 29 29
|
||||
27 27 29 29
|
||||
30 30 30 30
|
||||
-- ROWS offset frame start
|
||||
-- CURRENT ROW and offset for ROWS frame start
|
||||
select number, p,
|
||||
count(*) over (partition by p order by number
|
||||
rows between 1 preceding and unbounded following),
|
||||
|
@ -167,6 +167,8 @@ settings max_block_size = 2;
|
||||
select number, p,
|
||||
count(*) over (partition by p order by number
|
||||
rows between 1 preceding and unbounded following),
|
||||
count(*) over (partition by p order by number
|
||||
rows between current row and unbounded following),
|
||||
count(*) over (partition by p order by number
|
||||
rows between 1 following and unbounded following)
|
||||
from (select number, intDiv(number, 5) p from numbers(31))
|
||||
|
Loading…
Reference in New Issue
Block a user