AbsaOSS / atum-service

Apache License 2.0
5 stars 1 forks source link

Figure out a preferable way to return checkpoints data. #177

Closed benedeki closed 4 months ago

benedeki commented 5 months ago

Background

As each counterpoint has (potentially) multiple measurements, if multiple checkpoints are to be returned from a function what would be the best way to return them.

Questions To Answer

  1. How to return data of multiple Checkpoints

Options

  1. Each measurement in each checkpoint are returned as one row, including checkpoint identification (grouping is done on app level)
  2. Measurements are grouped by checkpoint and returned in a complex type (`ARRAY[JSON]' perhaps?)
  3. No such possibility, there would be function to return checkpoints, and then each checkpoint would need to be queried separately
  4. Something different?

Desired Outcome

The method of choice to return these data.

### Tasks
- [ ] Questions have been answered or we have a clearer idea of how to get to our goal
- [ ] Discussion with the team
- [ ] Documentation
- [ ] Create recommendations and new implementation tickets
- [ ] item here..

Additional Info/Resources [Optional]

benedeki commented 5 months ago

Changing it rather to Question instead of Spike.

benedeki commented 5 months ago

After some impromptu conversation in the office we figured that the best slution, at least for now is:

    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

always ordered by id_checkpoint first to ensure, that measurements from the same checkpoint are after each other.