mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
BETWEEN CURRENT ROW AND CURRENT ROW
This commit is contained in:
parent
35754abb4a
commit
ec382d8812
@ -101,6 +101,14 @@ void WindowFrame::checkValid() const
|
||||
return;
|
||||
}
|
||||
|
||||
if (end_type == BoundaryType::Current
|
||||
&& begin_type == BoundaryType::Current)
|
||||
{
|
||||
// BETWEEN CURRENT ROW AND CURRENT ROW makes some sense for RANGE or
|
||||
// GROUP frames, and is technically valid for ROWS frame.
|
||||
return;
|
||||
}
|
||||
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS,
|
||||
"Window frame '{}' is invalid",
|
||||
toString());
|
||||
|
@ -607,3 +607,10 @@ settings max_block_size = 2;
|
||||
26 5 2 2
|
||||
29 5 2 2
|
||||
30 6 0 1
|
||||
select
|
||||
count(*) over (rows between current row and current row),
|
||||
count(*) over (range between current row and current row)
|
||||
from numbers(3);
|
||||
1 3
|
||||
1 3
|
||||
1 3
|
||||
|
@ -191,3 +191,8 @@ from (select number, intDiv(number, 5) p, mod(number, 3) o
|
||||
from numbers(31))
|
||||
order by p, o, number
|
||||
settings max_block_size = 2;
|
||||
|
||||
select
|
||||
count(*) over (rows between current row and current row),
|
||||
count(*) over (range between current row and current row)
|
||||
from numbers(3);
|
||||
|
Loading…
Reference in New Issue
Block a user