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

Denys Kuzmenko updated HIVE-30122:
----------------------------------
    Description: 
{code}

┌────────────────────────────────────┬─────────────────────────────┬──────────────────────────────────┐
                                                                                
               
  │ Query on a table with a unique key │       Default result        │          
   Correct              │                                                       
                                        
  
├────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────┤
                                                                                
               
  │ k, sum(x), count(x), count(*)      │ 1,2,2,2 / 2,1,1,1 / 3,3,3,3 │ 1,20,2,2 
/ 2,20,1,1 / 3,NULL,0,3 │                                                       
                                        
  
├────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────┤
                                                                                
               
  │ k, y, sum(y)                       │ 1→2 / 2→1 / 3→3             │ 1→200 / 
2→200 / 3→900            │                                                      
                                         
  
├────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────┤
                                                                                
               
  │ min(x) / max(x)                    │ fails to compile            │ correct 
values                   │                                                      
                                         
  
└────────────────────────────────────┴─────────────────────────────┴──────────────────────────────────┘
    

{code}

> CBO: HiveAggregateJoinTransposeRule drops aggregate arguments from a unique 
> join side, returning wrong results
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-30122
>                 URL: https://issues.apache.org/jira/browse/HIVE-30122
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Denys Kuzmenko
>            Priority: Major
>
> {code}
> ┌────────────────────────────────────┬─────────────────────────────┬──────────────────────────────────┐
>                                                                               
>                  
>   │ Query on a table with a unique key │       Default result        │        
>      Correct              │                                                   
>                                             
>   
> ├────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────┤
>                                                                               
>                  
>   │ k, sum(x), count(x), count(*)      │ 1,2,2,2 / 2,1,1,1 / 3,3,3,3 │ 
> 1,20,2,2 / 2,20,1,1 / 3,NULL,0,3 │                                            
>                                                    
>   
> ├────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────┤
>                                                                               
>                  
>   │ k, y, sum(y)                       │ 1→2 / 2→1 / 3→3             │ 1→200 
> / 2→200 / 3→900            │                                                  
>                                              
>   
> ├────────────────────────────────────┼─────────────────────────────┼──────────────────────────────────┤
>                                                                               
>                  
>   │ min(x) / max(x)                    │ fails to compile            │ 
> correct values                   │                                            
>                                                    
>   
> └────────────────────────────────────┴─────────────────────────────┴──────────────────────────────────┘
>     
> {code}



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

Reply via email to