aboutsummaryrefslogblamecommitdiff
path: root/sql/hive/src/test/resources/golden/udf_unhex-2-a660886085b8651852b9b77934848ae4
blob: 97af3b812a4295d6f54a89a3f80478a2b8f417eb (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                  
unhex(str) - Converts hexadecimal argument to binary
Performs the inverse operation of HEX(str). That is, it interprets
each pair of hexadecimal digits in the argument as a number and
converts it to the byte representation of the number. The
resulting characters are returned as a binary string.

Example:
> SELECT DECODE(UNHEX('4D7953514C'), 'UTF-8') from src limit 1;
'MySQL'

The characters in the argument string must be legal hexadecimal
digits: '0' .. '9', 'A' .. 'F', 'a' .. 'f'. If UNHEX() encounters
any nonhexadecimal digits in the argument, it returns NULL. Also,
if there are an odd number of characters a leading 0 is appended.