Taraka Rama Rao Lethavadla created HIVE-27681:
-------------------------------------------------

             Summary: Either insert operation or select queries having Array 
UDFs throw errors when elment type is varchar
                 Key: HIVE-27681
                 URL: https://issues.apache.org/jira/browse/HIVE-27681
             Project: Hive
          Issue Type: Sub-task
          Components: HiveServer2
            Reporter: Taraka Rama Rao Lethavadla
            Assignee: Taraka Rama Rao Lethavadla


*Test Queries*
{noformat}
CREATE TABLE temp (top ARRAY<STRING>);
insert into temp values(array(cast('true' as VARCHAR(10))));
select array_contains(top,cast(true as VARCHAR(10))) from temp;
{noformat}
 

*Exception*

 
{noformat}
org.apache.hadoop.hive.ql.parse.SemanticException: Line 0:-1 Argument type 
mismatch ''TRUE'': "varchar(10)" expected at function ARRAY_CONTAINS, but 
"string" is found
    at 
org.apache.hadoop.hive.ql.parse.type.TypeCheckProcFactory$DefaultExprProcessor.process(TypeCheckProcFactory.java:1473){noformat}
As per [Allowed Implicit 
Conversions|https://cwiki.apache.org/confluence/display/hive/languagemanual+types#LanguageManualTypes-AllowedImplicitConversions]
 String and varchar are convertible.  So we can modify this check and allow 
varchar <-> String conversion

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to