ProvSQL SQL API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
choose aggregate

Choose one value among many, used in particular to code a mutually exclusive choice as an aggregate. More...

Functions

ANYELEMENT provsql.choose_function (ANYELEMENT state, ANYELEMENT data)
 Transition function for the choose aggregate (keeps first non-NULL value).
VOID provsql.choose (ANYELEMENT)
 Aggregate that returns an arbitrary non-NULL value from a group.
ANYARRAY provsql.array_collect_step (ANYARRAY state, ANYNONARRAY data)
 Transition function of array_collect.
VOID provsql.array_collect (ANYNONARRAY)
 array_agg, but the empty array over no rows, not NULL
VOID provsql.explode_table (TEXT _tbl, TEXT AGG_TOKEN)
 Explodes a table column containing aggregated provenance into multiple rows.

Detailed Description

Choose one value among many, used in particular to code a mutually exclusive choice as an aggregate.

Function Documentation

◆ array_collect()

VOID provsql.array_collect ( ANYNONARRAY )

array_agg, but the empty array over no rows, not NULL

This is the value of ARRAY(SELECT ...): ProvSQL rewrites such a subquery into this aggregate over the matching rows.

Source code
provsql.sql line 11805

◆ array_collect_step()

ANYARRAY provsql.array_collect_step ( ANYARRAY state,
ANYNONARRAY data )

Transition function of array_collect.

Source code
provsql.sql line 11796

◆ choose()

VOID provsql.choose ( ANYELEMENT )

Aggregate that returns an arbitrary non-NULL value from a group.

Source code
provsql.sql line 11790

◆ choose_function()

ANYELEMENT provsql.choose_function ( ANYELEMENT state,
ANYELEMENT data )

Transition function for the choose aggregate (keeps first non-NULL value).

Source code
provsql.sql line 11777

◆ explode_table()

VOID provsql.explode_table ( TEXT _tbl,
TEXT AGG_TOKEN )

Explodes a table column containing aggregated provenance into multiple rows.

For each row in the input table, this function unnests the children of the specified aggregate token column and produces one output row per child. It reconstructs the corresponding value and provenance (provsql) for each resulting row.

The original table is replaced by the transformed table.

Parameters
_tblName of the table to transform.
AGG_TOKENName of the column containing the aggregate to explode.
Source code
provsql.sql line 11823