ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
agg_token.h
Go to the documentation of this file.
1/**
2 * @file agg_token.h
3 * @brief Aggregate-provenance token type used in SQL aggregate functions.
4 *
5 * Defines the @c agg_token composite type that pairs a provenance circuit
6 * UUID (as a hex string) with an aggregate running value. It is passed
7 * between the transition and final functions of ProvSQL's custom
8 * aggregate operators so that both the provenance token and its
9 * associated numeric value travel together through a GROUP BY query.
10 */
11#ifndef AGG_TOKEN_H
12#define AGG_TOKEN_H
13
14#include "provsql_utils.h"
15
16/**
17 * @brief Aggregate token bundling a provenance UUID with a running value.
18 *
19 * @c tok holds the UUID of the provenance circuit gate for the current
20 * aggregate group, formatted as a 36-character string
21 * (@c xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx plus a NUL terminator).
22 * The buffer size @c 2*UUID_LEN+5 accommodates the standard UUID text
23 * representation.
24 *
25 * @c val holds the textual representation of the current aggregate value
26 * (e.g., a decimal integer or floating-point number). An 80-character
27 * buffer is sufficient for all numeric types supported by ProvSQL.
28 */
29typedef struct agg_token {
30 char tok[2*UUID_LEN+5]; ///< Provenance UUID as a text string
31 char val[80]; ///< Aggregate running value as a text string
32} agg_token;
33
34#endif /* AGG_TOKEN_H */
Core types, constants, and utilities shared across ProvSQL.
#define UUID_LEN
Number of bytes in a UUID.
Aggregate token bundling a provenance UUID with a running value.
Definition agg_token.h:29
char val[80]
Aggregate running value as a text string.
Definition agg_token.h:31
char tok[2 *UUID_LEN+5]
Provenance UUID as a text string.
Definition agg_token.h:30