We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The builtin dbt hash macro expands to include a cast to TEXT which is not supported in Dremio. i.e
hash
TEXT
dbt.hash('foo')
resolves to
md5(cast(foo as TEXT))
The macro should cast to a supported data type i.e:
md5(cast(foo as VARCHAR))
Create a macro to log the output of dbt.hash
{%- macro log_hash(field) -%} {{ log(dbt.hash('foo'), True) }} {% endmacro %}
execute:
dbt run-operation log_hash --args '{"field": "a"}'
output:
10:29:23 Running with dbt=1.4.5 10:29:24 md5(cast(foo as TEXT))
- OS: Ubuntu 22 - dbt-dremio: 1.4.5 - Dremio Software: 24.0.2 - Dremio Cloud: No
No response
The text was updated successfully, but these errors were encountered:
You can see where the hash macro is implemented here
I think the fix would be for the Dremio adapter to override the TYPE_LABELS dictionary in the Column class as shown here in the BigQuery adapter.
TYPE_LABELS
Column
BigQuery
Sorry, something went wrong.
Until a fix is in place you can create you own macro as a workaround. (you probably already know this):
{% macro dremio__hash(field) -%} md5(cast({{ field }} as varchar)) {%- endmacro %}
I really love how easy it is to make these adapter specific macros. :)
Thanks @Conq1. I'm able to work around the problem by implementing dremio__hash as you describe. I agree its very useful to be able to do this!
dremio__hash
No branches or pull requests
Is there an existing issue for this?
Current Behavior
The builtin dbt
hash
macro expands to include a cast toTEXT
which is not supported in Dremio. i.eresolves to
Expected Behavior
The macro should cast to a supported data type i.e:
Steps To Reproduce
Create a macro to log the output of dbt.hash
execute:
output:
Environment
Relevant log output
No response
The text was updated successfully, but these errors were encountered: