You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Chao (JIRA)" <ji...@apache.org> on 2014/07/15 23:59:07 UTC
[jira] [Updated] (HIVE-6560) varchar and char types cannot be cast
to binary
[ https://issues.apache.org/jira/browse/HIVE-6560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chao updated HIVE-6560:
-----------------------
Attachment: HIVE-6560.1.patch
I've proposed a patch for this issue,. Can someone please give a review for this? Thanks.
> 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.12.0
> Reporter: Xuefu Zhang
> Assignee: Xuefu Zhang
> 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)