diff --git a/dbt/include/hive/macros/utils/right.sql b/dbt/include/hive/macros/utils/right.sql index 10b0006..e5f00c4 100644 --- a/dbt/include/hive/macros/utils/right.sql +++ b/dbt/include/hive/macros/utils/right.sql @@ -16,7 +16,7 @@ {% macro hive__right(string_text, length_expression) %} case when {{ length_expression }} = 0 - then NULL + then '' else substr( {{ string_text }}, diff --git a/tests/functional/adapter/test_utils.py b/tests/functional/adapter/test_utils.py index 429103c..38932c3 100644 --- a/tests/functional/adapter/test_utils.py +++ b/tests/functional/adapter/test_utils.py @@ -237,32 +237,8 @@ def models(self): } -models__test_concat_sql = """ -with util_data as ( - - select * from {{ ref('data_concat') }} - -) - -select - {{ concat(['input_1', 'input_2']) }} as actual, - output as expected - -from util_data -""" - - class TestConcat(BaseConcat): - @pytest.fixture(scope="class") - def seeds(self): - return {"data_concat.csv": seeds__data_concat_csv} - - @pytest.fixture(scope="class") - def models(self): - return { - "test_concat.yml": models__test_concat_yml, - "test_concat.sql": self.interpolate_macro_namespace(models__test_concat_sql, "concat"), - } + pass models__test_dateadd_sql = """ @@ -389,32 +365,8 @@ class TestExcept(BaseExcept): pass -models__test_hash_sql = """ -with util_data as ( - - select * from {{ ref('data_hash') }} - -) - -select - {{ hash('input_1') }} as actual, - output as expected - -from util_data -""" - - class TestHash(BaseHash): - @pytest.fixture(scope="class") - def seeds(self): - return {"data_hash.csv": seeds__data_hash_csv} - - @pytest.fixture(scope="class") - def models(self): - return { - "test_hash.yml": models__test_hash_yml, - "test_hash.sql": self.interpolate_macro_namespace(models__test_hash_sql, "hash"), - } + pass class TestIntersect(BaseIntersect): @@ -642,28 +594,8 @@ def models(self): } -models__test_right_sql = """ -with util_data as ( - select * from {{ ref('data_right') }} -) -select - {{ right('string_text', 'length_expression') }} as actual, - coalesce(output, '') as expected -from util_data -""" - - class TestRight(BaseRight): - @pytest.fixture(scope="class") - def seeds(self): - return {"data_right.csv": seeds__data_right_csv} - - @pytest.fixture(scope="class") - def models(self): - return { - "test_right.yml": models__test_right_yml, - "test_right.sql": self.interpolate_macro_namespace(models__test_right_sql, "right"), - } + pass models__test_safe_cast_sql = """