unhex
function
Applies to: Databricks SQL Databricks Runtime
Converts hexadecimal expr
to BINARY.
Syntax
unhex(expr)
Arguments
expr
: A STRING expression of hexadecimal characters.
Returns
The result is BINARY.
If the length of expr
is odd, the first character is discarded and the result is padded with a null byte.
If expr
contains non hex characters the result is NULL.
Examples
> SELECT decode(unhex('537061726B2053514C'), 'UTF-8');
Spark SQL
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for