None of the following are currently supported:
RowRange(start=-2, end=-1)
ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING
RowRange(start=1, end=2)
ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING
It's also missing support for EXCLUDE.
ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW
--
Ticket URL: <https://code.djangoproject.com/ticket/29850>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
* type: Uncategorized => New feature
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:1>
* status: new => assigned
* owner: nobody => bcollazo
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:2>
* version: 2.1 => master
Old description:
> The current RowRange frame is missing handling for several cases.
>
> None of the following are currently supported:
> RowRange(start=-2, end=-1)
> ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING
> RowRange(start=1, end=2)
> ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING
>
> It's also missing support for EXCLUDE.
> ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW
New description:
The current RowRange frame is missing handling for several cases.
None of the following are currently supported:
RowRange(start=-2, end=-1)
ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING
RowRange(start=1, end=2)
ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING
It's also missing support for EXCLUDE.
ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW
----
Frame exclusion is supported only in [https://www.postgresql.org/docs/11
/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS PostgreSQL 11+], other
databases do not support exclusion (see
[https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf
/Analytic-Functions.html#GUID-527832F7-63C0-4445-8C16-307FA5084056 Oracle
18c doc], [https://mariadb.com/kb/en/library/window-functions-overview/
MariaDB doc], and [https://dev.mysql.com/doc/refman/8.0/en/window-
functions-frames.html MySQL doc]).
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:3>
* owner: Bryan Collazo => felixxm
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:4>
Old description:
> The current RowRange frame is missing handling for several cases.
>
> None of the following are currently supported:
> RowRange(start=-2, end=-1)
> ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING
> RowRange(start=1, end=2)
> ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING
>
> It's also missing support for EXCLUDE.
> ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW
>
> ----
>
> Frame exclusion is supported only in [https://www.postgresql.org/docs/11
> /sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS PostgreSQL 11+], other
> databases do not support exclusion (see
> [https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf
> /Analytic-Functions.html#GUID-527832F7-63C0-4445-8C16-307FA5084056 Oracle
> 18c doc], [https://mariadb.com/kb/en/library/window-functions-overview/
> MariaDB doc], and [https://dev.mysql.com/doc/refman/8.0/en/window-
> functions-frames.html MySQL doc]).
New description:
The current RowRange frame is missing handling for several cases.
None of the following are currently supported:
RowRange(start=-2, end=-1)
ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING
RowRange(start=1, end=2)
ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING
It's also missing support for EXCLUDE.
ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW
----
Frame exclusion is supported only in [https://www.postgresql.org/docs/11
/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS PostgreSQL 11+] and
[https://www.sqlite.org/windowfunctions.html#wexcls SQLite 3.28+], other
databases do not support exclusion (see
[https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf
/Analytic-Functions.html#GUID-527832F7-63C0-4445-8C16-307FA5084056 Oracle
18c doc], [https://mariadb.com/kb/en/library/window-functions-overview/
MariaDB doc], and [https://dev.mysql.com/doc/refman/8.0/en/window-
functions-frames.html MySQL doc]).
--
Comment (by felixxm):
Exclusion is supported also on SQLite 3.28+ (see
[https://www.sqlite.org/changes.html#version_3_28_0 release notes]).
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:5>
* keywords: => GSoC
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:6>
Comment (by Manav Agarwal):
Is it a good idea to add an argument named as exclude in WindowFrame class
in django.db.models.expressions? This argument will contain the F() value
of the row/range to be excluded.
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:7>
* owner: nobody => Manav Agarwal
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:8>
* owner: Manav Agarwal => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:9>
* cc: Raphael Michel, Mads Jensen (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:8>
* cc: John Speno (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:9>
Old description:
> The current RowRange frame is missing handling for several cases.
>
> None of the following are currently supported:
> RowRange(start=-2, end=-1)
> ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING
> RowRange(start=1, end=2)
> ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING
>
> It's also missing support for EXCLUDE.
> ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW
>
> ----
>
> Frame exclusion is supported only in [https://www.postgresql.org/docs/11
> /sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS PostgreSQL 11+] and
> [https://www.sqlite.org/windowfunctions.html#wexcls SQLite 3.28+], other
> databases do not support exclusion (see
> [https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf
> /Analytic-Functions.html#GUID-527832F7-63C0-4445-8C16-307FA5084056 Oracle
> 18c doc], [https://mariadb.com/kb/en/library/window-functions-overview/
> MariaDB doc], and [https://dev.mysql.com/doc/refman/8.0/en/window-
> functions-frames.html MySQL doc]).
New description:
The current RowRange frame is missing handling for several cases.
None of the following are currently supported:
RowRange(start=-2, end=-1)
ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING
RowRange(start=1, end=2)
ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING
It's also missing support for EXCLUDE.
ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW
----
Frame exclusion is supported in [https://www.postgresql.org/docs/11/sql-
expressions.html#SYNTAX-WINDOW-FUNCTIONS PostgreSQL 11+],
[https://www.sqlite.org/windowfunctions.html#wexcls SQLite 3.28+], and
[https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf
/Analytic-Functions.html#GUID-527832F7-63C0-4445-8C16-307FA5084056 Oracle
21c+] other databases do not support exclusion
([https://mariadb.com/kb/en/library/window-functions-overview/ MariaDB
doc], and [https://dev.mysql.com/doc/refman/8.0/en/window-functions-
frames.html MySQL doc]).
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:10>
* owner: nobody => Sarah Boyce
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:11>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:12>
* needs_better_patch: 0 => 1
Comment:
Frame exclusions can be one of:
- EXCLUDE CURRENT ROW
- EXCLUDE GROUP
- EXCLUDE TIES
- EXCLUDE NO OTHERS
Marking that patch needs improvement as will aim to provide support for
all types
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:13>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:14>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"6375cee490725969b4f67b3c988ef01350c1ad6d" 6375cee]:
{{{
#!CommitTicketReference repository=""
revision="6375cee490725969b4f67b3c988ef01350c1ad6d"
Refs #29850 -- Added RowRange support for positive integer start and
negative integer end.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:15>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:16>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"e4d012ca05b23445f422b0400d6dd7aa85743885" e4d012c]:
{{{
#!CommitTicketReference repository=""
revision="e4d012ca05b23445f422b0400d6dd7aa85743885"
Refs #29850 -- Added exclusion support to window frames.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:17>
* status: assigned => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:18>