[ 
https://issues.apache.org/jira/browse/BEAM-5962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rui Wang closed BEAM-5962.
--------------------------
       Resolution: Done
    Fix Version/s: Not applicable

> TO_HEX
> ------
>
>                 Key: BEAM-5962
>                 URL: https://issues.apache.org/jira/browse/BEAM-5962
>             Project: Beam
>          Issue Type: Sub-task
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>             Fix For: Not applicable
>
>
> TO_HEX(bytes)
> Converts a sequence of BYTES into a hexadecimal STRING. Converts each byte in 
> the STRING as two hexadecimal characters in the range (0..9, a..f). To 
> convert a hexadecimal-encoded STRING to BYTES, use FROM_HEX.
> Return type
> STRING
> Example
> WITH Input AS (
>   SELECT b'\x00\x01\x02\x03\xAA\xEE\xEF\xFF' AS byte_str UNION ALL
>   SELECT b'foobar'
> )
> SELECT byte_str, TO_HEX(byte_str) AS hex_str
> FROM Input;
> +----------------------------------+------------------+
> | byte_string                      | hex_string       |
> +----------------------------------+------------------+
> | foobar                           | 666f6f626172     |
> | \x00\x01\x02\x03\xaa\xee\xef\xff | 00010203aaeeefff |
> +----------------------------------+------------------+



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to