use camelCase

This commit is contained in:
Alexander Kuzmenkov 2021-03-25 18:49:01 +03:00
parent 02eee100a0
commit 8ea697b7df
5 changed files with 11 additions and 11 deletions

View File

@ -25,7 +25,7 @@ ClickHouse supports the standard grammar for defining windows and window functio
| `rank()`, `dense_rank()`, `row_number()` | supported |
| `lag/lead(value, offset)` | Not supported. Workarounds: |
| | 1) replace with `any(value) over (.... rows between <offset> preceding and <offset> preceding)`, or `following` for `lead`|
| | 2) use `lag_in_frame/lead_in_frame`, which are analogous, but respect the window frame. To get behavior identical to `lag/lead`, use `rows between unbounded preceding and unbounded following` |
| | 2) use `lagInFrame/leadInFrame`, which are analogous, but respect the window frame. To get behavior identical to `lag/lead`, use `rows between unbounded preceding and unbounded following` |
## References

View File

@ -1525,7 +1525,7 @@ void registerWindowFunctions(AggregateFunctionFactory & factory)
// be able to process at least the lag/lead in streaming fashion.
// A partial solution for constant offsets is rewriting, say `lag(value, offset)
// to `any(value) over (rows between offset preceding and offset preceding)`.
// We also implement non-standard functions `lag/lead_in_frame`, that are
// We also implement non-standard functions `lag/leadInFrame`, that are
// analogous to `lag/lead`, but respect the frame.
// Functions like cume_dist() do require materializing the entire
// partition, but it's probably also simpler to implement them by rewriting
@ -1553,14 +1553,14 @@ void registerWindowFunctions(AggregateFunctionFactory & factory)
parameters);
});
factory.registerFunction("lag_in_frame", [](const std::string & name,
factory.registerFunction("lagInFrame", [](const std::string & name,
const DataTypes & argument_types, const Array & parameters)
{
return std::make_shared<WindowFunctionLagLeadInFrame<false>>(
name, argument_types, parameters);
});
factory.registerFunction("lead_in_frame", [](const std::string & name,
factory.registerFunction("leadInFrame", [](const std::string & name,
const DataTypes & argument_types, const Array & parameters)
{
return std::make_shared<WindowFunctionLagLeadInFrame<true>>(

View File

@ -112,7 +112,7 @@
<!-- Our variant of lead. -->
<query>
select lead_in_frame(number) over w
select leadInFrame(number) over w
from
(select number, intDiv(number, 1111) p, mod(number, 111) o
from numbers(10000000)) t
@ -133,7 +133,7 @@
</query>
<query>
select lead_in_frame(number, number) over w
select leadInFrame(number, number) over w
from
(select number, intDiv(number, 1111) p, mod(number, 111) o
from numbers(10000000)) t
@ -143,7 +143,7 @@
</query>
<query>
select lead_in_frame(number, number, number) over w
select leadInFrame(number, number, number) over w
from
(select number, intDiv(number, 1111) p, mod(number, 111) o
from numbers(10000000)) t

View File

@ -1004,8 +1004,8 @@ from numbers(5);
3 \N
-- variants of lag/lead that respect the frame
select number, p, pp,
lag_in_frame(number, number - pp, number * 11) over w as lag,
lead_in_frame(number, number - pp, number * 11) over w as lead
lagInFrame(number, number - pp, number * 11) over w as lag,
leadInFrame(number, number - pp, number * 11) over w as lead
from (select number, intDiv(number, 5) p, p * 5 pp from numbers(16))
window w as (partition by p order by number
rows between unbounded preceding and unbounded following)

View File

@ -349,8 +349,8 @@ from numbers(5);
-- variants of lag/lead that respect the frame
select number, p, pp,
lag_in_frame(number, number - pp, number * 11) over w as lag,
lead_in_frame(number, number - pp, number * 11) over w as lead
lagInFrame(number, number - pp, number * 11) over w as lag,
leadInFrame(number, number - pp, number * 11) over w as lead
from (select number, intDiv(number, 5) p, p * 5 pp from numbers(16))
window w as (partition by p order by number
rows between unbounded preceding and unbounded following)