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

[SNOW-151] Initialize dynamic table: accessrequirement_latest #84

Merged
merged 9 commits into from
Nov 21, 2024

Conversation

jaymedina
Copy link
Contributor

@jaymedina jaymedina commented Nov 13, 2024

problem

  • The latest table for accessrequirementsnapshots does not exist in Snowflake.
  • Following versioning best practices for Schemachange, we should initialize the dynamic table from a separate V script to mark its introduction into the system.

solution

Add a V script to initialize accessrequirement_latest

testing

There are 3,878 unique access requirement IDs stored in the snapshots table, meaning there should be 3,878 total rows in the deduplicated latest table. The reason being that each submission can only be in 1 state - CREATED, UPDATED, or DELETED:

image

We verify that the V script generates a table with that many rows:

image

We verify that the 3,878 unique IDs in the snapshots table matches the 3,878 unique IDs in the latest table:

image

We use a few IDs to manually verify that the latest state of each submission is reflected in the latest table:

  • 1426937

Before
image

After
image

  • 1963045
    Before
image

After
image

@jaymedina jaymedina marked this pull request as ready for review November 14, 2024 19:01
@jaymedina jaymedina requested a review from a team as a code owner November 14, 2024 19:01
Copy link
Contributor

@danlu1 danlu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Excellent work. Going to pre-approve it.

Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philerooski / @jaymedina take a look at my most recent comment

Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 LGTM! I'll defer to @philerooski for final review

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 LGTM!

@jaymedina jaymedina merged commit dc09e50 into dev Nov 21, 2024
2 of 3 checks passed
@jaymedina jaymedina deleted the snow-151-init-ar-latest-table branch November 21, 2024 14:43
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.

4 participants