[Django] #29850: Poor Window Support for RowRange Frames

16 views
Skip to first unread message

Django

unread,
Oct 15, 2018, 2:55:45 PM10/15/18
to django-...@googlegroups.com
#29850: Poor Window Support for RowRange Frames
-------------------------------------+-------------------------------------
Reporter: dafuchs | Owner: nobody
Type: | Status: new
Uncategorized |
Component: Database | Version: 2.1
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/29850>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 15, 2018, 4:41:47 PM10/15/18
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 2.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted
* type: Uncategorized => New feature


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:1>

Django

unread,
Oct 17, 2018, 3:23:50 PM10/17/18
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: bcollazo
Type: New feature | Status: assigned

Component: Database layer | Version: 2.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bcollazo):

* status: new => assigned
* owner: nobody => bcollazo


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:2>

Django

unread,
Dec 27, 2018, 2:42:19 PM12/27/18
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Bryan
| Collazo

Type: New feature | Status: assigned
Component: Database layer | Version: master

(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* 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>

Django

unread,
Jan 3, 2019, 1:50:15 PM1/3/19
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: felixxm

Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* owner: Bryan Collazo => felixxm


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:4>

Django

unread,
Oct 9, 2019, 5:11:56 AM10/9/19
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: felixxm
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Dec 3, 2020, 2:32:31 PM12/3/20
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Mariusz
| Felisiak

Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* keywords: => GSoC


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:6>

Django

unread,
Jan 4, 2021, 5:50:20 PM1/4/21
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Jan 11, 2021, 9:59:54 PM1/11/21
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Manav
| Agarwal

Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Manav Agarwal):

* owner: nobody => Manav Agarwal


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:8>

Django

unread,
Mar 30, 2021, 6:20:20 AM3/30/21
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: (none)

Type: New feature | Status: new
Component: Database layer | Version: dev

(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Manav Agarwal):

* owner: Manav Agarwal => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:9>

Django

unread,
Aug 30, 2021, 6:50:54 AM8/30/21
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: nobody

Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Raphael Michel, Mads Jensen (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:8>

Django

unread,
Aug 16, 2022, 1:33:48 PM8/16/22
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by John Speno):

* cc: John Speno (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:9>

Django

unread,
Feb 2, 2023, 4:02:06 AM2/2/23
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Mariusz Felisiak:

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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:10>

Django

unread,
Oct 22, 2023, 8:45:58 AM10/22/23
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Sarah
| Boyce

Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* owner: nobody => Sarah Boyce


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:11>

Django

unread,
Oct 25, 2023, 11:35:07 AM10/25/23
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Sarah
| Boyce
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:12>

Django

unread,
Oct 25, 2023, 12:30:48 PM10/25/23
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Sarah
| Boyce
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* 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>

Django

unread,
Oct 25, 2023, 2:52:45 PM10/25/23
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Sarah
| Boyce
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:14>

Django

unread,
Oct 28, 2023, 4:14:38 PM10/28/23
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Sarah
| Boyce
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Oct 30, 2023, 7:06:02 AM10/30/23
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Sarah
| Boyce
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:16>

Django

unread,
Oct 30, 2023, 7:42:47 AM10/30/23
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Sarah
| Boyce
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: GSoC | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Oct 30, 2023, 7:43:30 AM10/30/23
to django-...@googlegroups.com
#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
Reporter: Daniel Fuchs | Owner: Sarah
| Boyce
Type: New feature | Status: closed

Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: GSoC | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* resolution: => fixed


--
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:18>

Reply all
Reply to author
Forward
0 new messages