Fix rsrc static missmatch in snowflake - #502
Open
thoffmann-sf wants to merge 4 commits into
Open
thoffmann-sf wants to merge 4 commits into
thoffmann-sf wants to merge 4 commits into
Conversation
Fixed RSRC Static missmatch as snowflake does not support wildcard operators in = instead it has to use the keyword like
Fixed RSRC static missmatch as snowflake does not support wildcard operators in = instead it has to use the keyword like
Fixed RSRC static missmatch as snowflake does not support wildcard operators in = instead it has to use the keyword like
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Documented * wildcards remain incompatible with SQL LIKE, requiring normalization or contract updates and regression coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates Snowflake rsrc_static filtering to use LIKE instead of equality checks.
Changes:
- Modified hub filtering.
- Modified link filtering.
- Modified non-historized link filtering.
File summaries
| File | Description |
|---|---|
macros/tables/snowflake/hub.sql |
Updates hub source filtering. |
macros/tables/snowflake/link.sql |
Updates link source filtering. |
macros/tables/snowflake/nh_link.sql |
Updates non-historized link filtering. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Adding documentation to the rsrs_static page for the Snowflake special case
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Snowflake _ wildcard handling and inconsistent documented examples must be addressed.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 4
- Review effort level: Lite
| WHERE | ||
| {% for rsrc_static in rsrc_statics %} | ||
| (src.{{ src_rsrc }} = '{{ rsrc_static }}' AND src.{{ src_ldts }} > ( | ||
| (src.{{ src_rsrc }} like '{{ rsrc_static }}' AND src.{{ src_ldts }} > ( |
| WHERE | ||
| {% for rsrc_static in rsrc_statics %} | ||
| (src.{{ src_rsrc }} = '{{ rsrc_static }}' AND src.{{ src_ldts }} > ( | ||
| (src.{{ src_rsrc }} like '{{ rsrc_static }}' AND src.{{ src_ldts }} > ( |
| WHERE | ||
| {% for rsrc_static in rsrc_statics %} | ||
| (src.{{ src_rsrc }} = '{{ rsrc_static }}' AND src.{{ src_ldts }} > ( | ||
| (src.{{ src_rsrc }} like '{{ rsrc_static }}' AND src.{{ src_ldts }} > ( |
Comment on lines
+68
to
+71
| Therefore, when configuring rsrc_static for Snowflake: | ||
|
|
||
| - Use `%` as the wildcard character instead of `*`. | ||
| - Wildcard-based rsrc_static values are evaluated using the `LIKE` operator. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixed RSRC static missmatch as snowflake does not support wildcard operators in = instead it has to use the keyword like
When the rsrc_static is defined as rsrc_static = '%Test123%' snowflake trests it as string literal in the where clause of src_new_x
` src_new_1 AS (
Therefore not resolving the right entries in a delta load this is fixed by replacing the src.rsrc = with an src.rsrc like
Which I've done in the Hub, Link and nh_link the rec_track_satellite does not need this yet as it's still in the old format like hubs, links and nh_links used to be in
Fixes #(issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
I've testes the entities cause after a full DV refresh the next daily load produced relationship errors between sat's and links/hubs. I've implemented the changes locally and ran the entities again and the newest delta was successfully loaded
Test Configuration:
Checklist: