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 output SQL for this macro for Trino is:-
LOWER( TO_HEX( MD5( CONCAT( CAST(COALESCE(CAST("column_a" AS VARCHAR), '_sqlmesh_surrogate_key_null_') AS VARCHAR), CAST('|' AS VARHCAR), CAST(COALESCE(CAST("column_b" AS VARCHAR), '_sqlmesh_surrogate_key_null_') AS VARCHAR) ) ) ) )
But Trino wants it as a varbinary https://trino.io/docs/current/functions/binary.html#md5
io.trino.spi.TrinoException: line 1:2496: Unexpected parameters (varchar) for function md5. Expected: md5(varbinary)
So you need to encode it first with TO_UTF8 https://trino.io/docs/current/functions/string.html#to_utf8
LOWER( TO_HEX( MD5( TO_UTF8( CONCAT( CAST(COALESCE(CAST("column_a" AS VARCHAR), '_sqlmesh_surrogate_key_null_') AS VARCHAR), CAST('|' AS VARHCAR), CAST(COALESCE(CAST("column_b" AS VARCHAR), '_sqlmesh_surrogate_key_null_') AS VARCHAR) ) ) ) ) )
Many thanks in advance!
The text was updated successfully, but these errors were encountered:
Hey @MikeWallis42, thank you for reporting this! We'll take a look soon.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The output SQL for this macro for Trino is:-
But Trino wants it as a varbinary https://trino.io/docs/current/functions/binary.html#md5
So you need to encode it first with TO_UTF8 https://trino.io/docs/current/functions/string.html#to_utf8
Many thanks in advance!
The text was updated successfully, but these errors were encountered: