You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Xuefu Zhang (JIRA)" <ji...@apache.org> on 2014/07/16 00:11:04 UTC
[jira] [Assigned] (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 ]
Xuefu Zhang reassigned HIVE-6560:
---------------------------------
Assignee: Chao (was: Xuefu Zhang)
> 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: 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)