Details
Description
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,
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.