[
https://issues.apache.org/jira/browse/HIVE-27681?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Taraka Rama Rao Lethavadla updated HIVE-27681:
----------------------------------------------
Summary: select queries having Array UDFs throw errors when element type is
varchar (was: Either insert operation or select queries having Array UDFs
throw errors when elment type is varchar)
> select queries having Array UDFs throw errors when element 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
> Priority: Major
>
> *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)