-
Notifications
You must be signed in to change notification settings - Fork 491
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
get_tables_by_pattern_sql To Allow More Complex Pattern Matching #648
Comments
link to line of code seems to have disappeared, but this is the line which I think needs ability for more complex pattern matching: https://github.com/dbt-labs/dbt-utils/blob/main/macros/sql/get_tables_by_pattern_sql.sql#L14 |
@CharlieJ20 Another interesting one! I'm less averse to this one, but still have a couple of comments:
I'd welcome a PR to change this behaviour, as long as it doesn't break the existing usages and gives consistent results. Another potential approach for you is to cast too wide a net using this macro as-is, and then iterate over it using the |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers. |
Describe the feature
Currently it finds tables based on SQL ilike, but I've had to make some slight alterations to allow more complex matching through REGEXP.
Describe alternatives you've considered
None, the pattern i needed to match was not possible with ilike
Additional context
Using Snowflake and currently running on DBT 1.0.8.
Who will this benefit?
Anyone who needs to union tables that have naming structures more complex than SQL ilike allows. In my example, the tables were analogous to "Table" being unioned to "Table_S2", which doesn't have an ilike regex comparison that matches both, but regexp allows the following pattern to work: "Table(()|_S\d)"
Are you interested in contributing this feature?
The text was updated successfully, but these errors were encountered: