AbsaOSS / atum-service

Apache License 2.0
5 stars 1 forks source link

Create DB function to get all checkpoint data of a flow #187

Closed benedeki closed 4 months ago

benedeki commented 4 months ago

Background

We need to read all the measurements across a checkpoint of certain name within a flow.

Feature

Create a DB function that will return all checkpoint and its measurements for the given flow (identified by main partitioning)

Proposed Solution

Function signature

CREATE OR REPLACE FUNCTION flows.get_flow_checkpoints(
    IN i_flow_partitioning  JSONB,
    IN i_limit             INT DEFAULT 5,
    IN i_checkpoint_name   TEXT DEFAULT NULL,
    OUT status             INTEGER,
    OUT status_text        TEXT,
    OUT id_checkpoint      UUID,
    OUT checkpoint_name    TEXT,
    OUT measure_name       TEXT,
    OUT measure_columns    TEXT[],
    OUT measurement_value  JSONB,
    OUT checkpoint_time    TIMESTAMP WITH TIME ZONE
) RETURNS SETOF record AS

for output order by checkpoint_time and id_checkpoint

i_limit and i_checkpoint_nameare optional. IfNULL` no limit and no filter on checkpoint name.

Depends on #178

benedeki commented 4 months ago

This item depends on: