Skip to content

Feat/migrate xg3 - #134

Draft
droomelotdegendt wants to merge 2 commits into
feat/migrate-locsfrom
feat/migrate-xg3
Draft

Feat/migrate xg3#134
droomelotdegendt wants to merge 2 commits into
feat/migrate-locsfrom
feat/migrate-xg3

Conversation

@droomelotdegendt

Copy link
Copy Markdown
Collaborator

Goal

Migrate function get_xg3 to new data warehouse 'W0002_10_Watina'.

The table structure of the new DWH is slightly different, therefore not only the table names but the entire query logic is altered.

Key changes

  • New function build_xg3_query to separate all DWH query logic
  • Schema updates:
    • Change table name reference (vwDimMeetpunt --> DimMeetpunt)
    • Swap the legacy precalculated table ssrs_Precalc for the new fact table FactBRPeilMetingJaar
    • Add filter IsHydroYear == 1 to exclude calendaryears
  • Activate unused parameters:
    • Integrate table DimParameterSet into query logic and filter table based on the input parameters truncated (IsAfgetopt) and with_estimated (IsEstimated)
    • Change default values of truncated and with_estimated to FALSE
      • The column IsEstimated only has values FALSE --> otherwise nothing would be selected
      • As the parameters were previously ignored it was always FALSE? Is this correct (see section Open questions)?
    • Add validation check to always select exactly one parameter set
      • If no options remain, an error is returned
      • If multiple options remain, a warning returns that multiple options were found and states which parameter is selected

Open questions

  • Should we use other default settings for truncated and is_estimated?
  • Is the current fallback logic to select one parameter correct?
  • Are extra arguments needed to filter the table DimParameterSet?
  • Should an argument be added to select HydroYear or CalendarYear?

Migration checks

To verify the code changes, the DWH migration snapshot were compared before and after migration (see the testing README for more information), but the output has some changes. Extra check necessary from someone with business knowledge.

Note: to only check the DWH query changes, look at feat(get_xg3): migrate to new DWH 'W0002_10_WATINA' separately

Extract DWH specific query logic into separate function to prepare for DWH migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant