ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
cume_dist_ctx Struct Reference

Compute the aggregation of q in a subquery, and its windows over that subquery's columns. More...

Collaboration diagram for cume_dist_ctx:

Public Attributes

const constants_t * constants
Query * q
 The query whose windows are rewritten.
bool rewritten
 One was.
bool declined
 One could not be.

Detailed Description

Compute the aggregation of q in a subquery, and its windows over that subquery's columns.

A window that reads an aggregate of its own query level – rank() OVER (ORDER BY count(*)), sum(count(*)) OVER () – is the window over the rows of the aggregation, which the rewritings read as a relation of its own: the aggregation moves to a subquery exposing its grouping columns and its aggregates, and the query keeps the windows, over those columns. The rank of a window over an aggregate result is then rewritten (rewrite_rank_over_aggregate).

Returns NULL, leaving q alone, when no window reads an aggregate of q, or on a shape it does not split (a DISTINCT, an ORDER BY or a LIMIT of its own, a set operation, a WITH).

Context for cume_dist_mutator.

Definition at line 26774 of file provsql.c.

Member Data Documentation

◆ constants

const constants_t* cume_dist_ctx::constants

Definition at line 26775 of file provsql.c.

◆ declined

bool cume_dist_ctx::declined

One could not be.

Definition at line 26778 of file provsql.c.

◆ q

Query* cume_dist_ctx::q

The query whose windows are rewritten.

Definition at line 26776 of file provsql.c.

◆ rewritten

bool cume_dist_ctx::rewritten

One was.

Definition at line 26777 of file provsql.c.


The documentation for this struct was generated from the following file:
  • /home/senellar/git/software/provsql/src/provsql.c