On this page

    Categories: Conversion

    CONVERT_TO

    Converts a value to a binary string of a supported data type.

    Syntax

    CONVERT_TO(expression value_to_convert, data_type name_of_type) → VARBINARY

    • expression: The value to convert to a binary string.
    • data_type: The data type to use for the conversion to a binary string.

    Examples

    SELECT CONVERT_TO('this value' ,'UTF8')
    -- dGhpcyB2YWx1ZQ==
    

    Usage Notes

    You can convert values to binary strings of these data types:

    • BIGINT_BE
    • BIGINT_HADOOPV
    • BIGINT
    • BOOLEAN_BYTE
    • DATE_EPOCH_BE
    • DATE_EPOCH
    • DOUBLE_BE
    • DOUBLE
    • EXTENDEDJSON
    • FLOAT_BE
    • FLOAT
    • INT_BE
    • INT_HADOOPV
    • INT
    • JSON
    • SIMPLEJSON
    • TIME_EPOCH_BE
    • TIME_EPOCH
    • TIMESTAMP_EPOCH_BE
    • TIMESTAMP_EPOCH
    • UTF8