The datatype of token_id of erc721 is uint256. On the other side, Spark uses a 8-byte integer number to calculate conv internally.
The following macro will fail to return the token id correctly when it exceed 18446744073709551615(2^64-1)
{% macro default__binary_to_numeric(expression) %}
cast(conv(hex({{ expression }}), 16, 10) as {{ dbt_utils.type_numeric() }})
{% endmacro %}