Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: create/update a View on top of hNhM tables #11

Merged
merged 6 commits into from
May 18, 2023

Conversation

marchinho11
Copy link
Owner

@marchinho11 marchinho11 commented May 16, 2023

Why?

  • hnhm creates a bunch of tables in the DDS layer, to wire them all together you should write SQLs like:
    SELECT
         hub__review.review_sk,
         group__review__review.rating AS review__rating,
         group__review__review.text AS review__text,
         ...
    FROM
         hub__review
    LEFT JOIN
         group__review__review
         ON hub__review.review_sk = group__review__review.review_sk
         AND group__review__review.valid_to = 'infinity'
    ...

What?

  • Add a feature to manage a View on top of the hNhM tables
  • Now it's easy to select data for the whole entity, no matter how many attributes or groups it contains:
    SELECT
        user_sk,
        name,
        age,
        contacts__mail,
        contacts__phone
    FROM
        entity__user
  • This view contains the latest data (for tables in the SCD2 it uses the filter valid_from = 'infinity')

@marchinho11 marchinho11 added the enhancement New feature or request label May 16, 2023
@marchinho11 marchinho11 self-assigned this May 16, 2023
@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #11 (01a41a0) into main (5e4bf5a) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #11      +/-   ##
==========================================
+ Coverage   97.79%   97.87%   +0.07%     
==========================================
  Files          33       23      -10     
  Lines         909      939      +30     
==========================================
+ Hits          889      919      +30     
  Misses         20       20              
Impacted Files Coverage Δ
hnhm/core/__init__.py 100.00% <ø> (ø)
hnhm/core/attribute.py 100.00% <100.00%> (ø)
hnhm/core/entity.py 100.00% <100.00%> (ø)
hnhm/core/group.py 100.00% <100.00%> (ø)
hnhm/core/migrations.py 100.00% <100.00%> (ø)
hnhm/core/priority.py 100.00% <100.00%> (ø)
hnhm/core/storage.py 100.00% <100.00%> (ø)
hnhm/file_storage.py 100.00% <100.00%> (ø)
hnhm/flow.py 95.65% <100.00%> (ø)
hnhm/hnhm.py 98.79% <100.00%> (+0.11%) ⬆️
... and 5 more

@marchinho11 marchinho11 merged commit 58cdb7e into main May 18, 2023
5 checks passed
@marchinho11 marchinho11 deleted the feature/entity-view branch May 18, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant