[ 
https://issues.apache.org/jira/browse/HIVE-8225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Shelukhin updated HIVE-8225:
-----------------------------------
    Attachment: HIVE-8225.inprogress.patch

Here's partial fix in process... first I tried using Optiq rules but that 
doesn't work due to some problems with transform (described in the patch).
I added a fix to post-CBO plan processing (before AST conversion), which fixes 
the issue for one small query that originally had the problem (see q file), but 
not for the original query. I'd need to take a look at that (probably the fix 
needs to be in a better place, or some check mismatches), for now attaching the 
in-progress patch since I will be on vacation soon

> CBO trunk merge: union11 test fails due to incorrect plan
> ---------------------------------------------------------
>
>                 Key: HIVE-8225
>                 URL: https://issues.apache.org/jira/browse/HIVE-8225
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>         Attachments: HIVE-8225.inprogress.patch
>
>
> The result changes to as if the union didn't have count() inside. The issue 
> can be fixed by using srcunion.value outside the subquery in count (replace 
> count(1) with count(srcunion.value)). Otherwise, it looks like count(1) node 
> from union-ed queries is not present in AST at all, which might cause this 
> result.
> -Interestingly, adding group by to each query in a union produces completely 
> weird result (count(1) is 309 for each key, whereas it should be 1 and the 
> "logical" incorrect value if internal count is lost is 500)- Nm, that groups 
> by table column called key, which is weird but is what Hive does



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to