[ 
https://issues.apache.org/jira/browse/HIVE-17535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16170749#comment-16170749
 ] 

Vineet Garg commented on HIVE-17535:
------------------------------------

Latest patch(3) has known failure {{min_structvalue}} which is a bug exposed by 
the patch. Queries such as {code:sql} select max(a), min(a) FROM (select 
named_struct("field",1) as a union all select named_struct("field",2) as a 
union all select named_struct("field",cast(null as int)) as a) tmp{code} fails 
with CBO because CBO ends up loosing {{CAST}} operation resulting in 
{{named_struct("field",cast(null as int)}} to just 
{{named_struct("field",null}}. This results in different schema structure b/w 
union statements which is semantically incorrect. {{
This could be reproduced using simple {code:sql}select 
named_struct("field",cast(null as int)) as a{code}. If we dump new ast after 
CBO we will notice missing CAST operation.

> Select 1 EXCEPT Select 1 fails with NPE
> ---------------------------------------
>
>                 Key: HIVE-17535
>                 URL: https://issues.apache.org/jira/browse/HIVE-17535
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>            Reporter: Vineet Garg
>            Assignee: Vineet Garg
>         Attachments: HIVE-17535.1.patch, HIVE-17535.2.patch, 
> HIVE-17535.3.patch
>
>
> Since Hive CBO isn't able to handle queries with no table e.g. {{select 1}} 
> queries with SET operators fail (intersect requires CBO).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to