hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xuefu Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-6560) varchar and char types cannot be cast to binary
Date Tue, 15 Jul 2014 22:17:05 GMT

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

Xuefu Zhang updated HIVE-6560:
------------------------------

    Affects Version/s: 0.13.0
                       0.13.1
               Status: Patch Available  (was: Open)

> varchar and char types cannot be cast to binary
> -----------------------------------------------
>
>                 Key: HIVE-6560
>                 URL: https://issues.apache.org/jira/browse/HIVE-6560
>             Project: Hive
>          Issue Type: Bug
>          Components: Types, UDF
>    Affects Versions: 0.13.1, 0.13.0, 0.12.0
>            Reporter: Xuefu Zhang
>            Assignee: Chao
>         Attachments: HIVE-6560.1.patch
>
>
> GenericUDFToBinary can convert string to binary. VARCHAR and CHAR are substitutable with
string. Thus, GenericUDFToBinary should also be able to convert VARCHAR and CHAR to binary.
However,
> {code}
> hive> select binary(cast('abc' as varchar(5)) from decimal_udf limit 1;
> FAILED: ParseException line 1:40 missing ) at 'from' near '<EOF>'
> hive> select binary(cast('abc' as varchar(5))) from decimal_udf limit 1;
> FAILED: SemanticException Line 0:-1 Wrong arguments ''abc'': Only string or binary data
can be cast into binary data types.
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message