Skip to content

Commit 4daf9d5

Browse files
committed
added a contains macro for athena in the e2e tests (deprecated tests that are run by the CI of the elementary cli)
1 parent f88a31c commit 4daf9d5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

macros/utils/cross_db_utils/contains.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,16 @@
3030
lower({{ string }}) like lower('%{{ string_to_search }}%') then true
3131
else false end
3232
{%- endif %}
33+
{% endmacro %}
34+
35+
{% macro athena__contains(string, string_to_search, case_sensitive) %}
36+
{%- if case_sensitive %}
37+
case when
38+
{{ string }} like '%{{ string_to_search }}%' then true
39+
else false end
40+
{%- else %}
41+
case when
42+
lower({{ string }}) like lower('%{{ string_to_search }}%') then true
43+
else false end
44+
{%- endif %}
3345
{% endmacro %}

0 commit comments

Comments
 (0)