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/03/06 02:25:45 UTC

[jira] [Created] (HIVE-6560) varchar and char types cannot be cast to binary

Xuefu Zhang created HIVE-6560:
---------------------------------

             Summary: 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


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)