Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-Abraham committed Jul 3, 2024
1 parent 6ab998b commit 739fc40
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions velox/docs/functions/presto/binary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,22 @@ Binary Functions

.. function:: to_base32(varbinary) -> string

Encodes a binary ``varbinary`` value into its Base32 string representation.
This function generates padded Base32 strings by default.
Encodes a binary ``varbinary`` value into its Base32 string representation.
This function generates padded Base32 strings by default.

Examples
--------
Query to encode a binary value to a padded Base32 string:
::
Examples
--------
Query to encode a binary value to a padded Base32 string:
::
SELECT to_base32(ARRAY[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]); -- 'JBSWY3DPEBLW64TMMQ======'

Query to encode a binary value with fewer bytes:
::
Query to encode a binary value with fewer bytes:
::
SELECT to_base32(ARRAY[104, 101, 108, 108, 111]); -- 'NBSWY3DP'

In the above examples, the binary array `[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]` is encoded to the padded Base32 string 'JBSWY3DPEBLW64TMMQ======'.
The binary array `[104, 101, 108, 108, 111]` is encoded to 'NBSWY3DP'.
In the above examples, the binary array `[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]` is encoded to the padded Base32 string 'JBSWY3DPEBLW64TMMQ======'.
The binary array `[104, 101, 108, 108, 111]` is encoded to 'NBSWY3DP'.


.. function:: to_hex(binary) -> varchar

Expand Down

0 comments on commit 739fc40

Please sign in to comment.