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-172] Convert file_latest to dynamic table #110

Merged
merged 6 commits into from
Jan 31, 2025

Conversation

danlu1
Copy link
Contributor

@danlu1 danlu1 commented Jan 25, 2025

Problem:

Currently, the file_latest table is a table that is updated via upserting task and remove deleted records task that are based on filesnapshots stream. We want to convert it to dynamic table so it gets refreshed automatically.

Solution:
Following the instructions of this SOP:

  • Add a script to create a backup of the original file_latest table which need to be removed manually after validation
  • Add a script to delete the upserting task and deletion task for the original file_latest table
  • Add a script to delete stream for filesnapshots table that is referred in file_latest upserting and deletion task
  • Add a script to drop the original file_latest table so we can create a dynamic table with the same name
  • Create file_latest dynamic table and filter out records that are non-preview or status as available.
  • Add a script to add table and column comments.
  • Explicitly SELECT the columns when creating dynamic table to avoid errors if upstream table changes. See [SNOW-222] Reintroduce node_latest dynamic table #119 for more info.

@danlu1 danlu1 requested a review from a team as a code owner January 25, 2025 21:17
@danlu1 danlu1 changed the title Snow 172 file latest dynamic table [SNOW-172] Convert file_latest to dynamic table Jan 25, 2025
@danlu1
Copy link
Contributor Author

danlu1 commented Jan 29, 2025

Thanks guys for the feedback. @philerooski I keep the interval as 30 days here even though we don't filter out CHANGE_TYPE != DELETE. As what we discussed and archived here, for tables having CHANGE_TYPE with 'DELETE', we would use 30 days instead of 14 days.

@danlu1 danlu1 requested a review from philerooski January 29, 2025 23:45
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! tagging @philerooski for final review.

@danlu1 danlu1 merged commit 659e9e5 into dev Jan 31, 2025
3 checks passed
philerooski pushed a commit that referenced this pull request Feb 3, 2025
* convert file latest to dynamic table
philerooski pushed a commit that referenced this pull request Feb 3, 2025
* convert file latest to dynamic table
philerooski pushed a commit that referenced this pull request Feb 6, 2025
* convert file latest to dynamic table
philerooski pushed a commit that referenced this pull request Feb 6, 2025
* convert file latest to dynamic table
philerooski pushed a commit that referenced this pull request Feb 7, 2025
* convert file latest to dynamic table
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.

3 participants