Skip to content

Commit

Permalink
Merge pull request #135 from get-select/remove_regex_udf
Browse files Browse the repository at this point in the history
Remove regex UDF
  • Loading branch information
NiallRees authored Nov 6, 2023
2 parents 33aef12 + 31b3140 commit 4b00b5b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .changes/4.5.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## dbt-snowflake-monitoring 4.5.3 - November 06, 2023

### Features

- Remove regex UDF to avoid timeout ([#135](https://github.com/get-select/dbt-snowflake-monitoring/pull/135))


8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).

## dbt-snowflake-monitoring 4.5.3 - November 06, 2023

### Features

- Remove regex UDF to avoid timeout ([#135](https://github.com/get-select/dbt-snowflake-monitoring/pull/135))



## dbt-snowflake-monitoring 4.5.2 - October 30, 2023

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'dbt_snowflake_monitoring'
version: '4.5.2'
version: '4.5.3'
config-version: 2

profile: dbt_snowflake_monitoring
Expand Down
14 changes: 0 additions & 14 deletions macros/create_regexp_replace_udf.sql

This file was deleted.

4 changes: 2 additions & 2 deletions models/query_history_enriched.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ config(
materialized='incremental',
unique_key=['query_id', 'start_time'],
pre_hook=["{{ create_regexp_replace_udf(this) }}", "{{ create_merge_objects_udf(this) }}"]
pre_hook=["{{ create_merge_objects_udf(this) }}"]
) }}

with
Expand All @@ -10,7 +10,7 @@ query_history as (
*,

-- this removes comments enclosed by /* <comment text> */ and single line comments starting with -- and either ending with a new line or end of string
{{ this.database }}.{{ this.schema }}.dbt_snowflake_monitoring_regexp_replace(query_text, $$(/\*(.|\n|\r)*?\*/)|(--.*$)|(--.*(\n|\r))$$, '') as query_text_no_comments,
regexp_replace(query_text, $$(\/\*(.|\n|\r)*?\*\/)|(--.*$)|(--.*(\n|\r))|;$$, '') as query_text_no_comments,

try_parse_json(regexp_substr(query_text, '/\\*\\s({"app":\\s"dbt".*})\\s\\*/', 1, 1, 'ie')) as _dbt_json_comment_meta,
case
Expand Down

0 comments on commit 4b00b5b

Please sign in to comment.