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

Ashutosh Chauhan commented on HIVE-4143:
----------------------------------------

A simpler query which demonstrates the problem is:
{noformat}
select ts, dec, rnk
from
  (select ts, dec, rank() over (partition by ts)  as rnk
          from (select other.ts, other.dec
             from over10k other join over10k on (other.b = over10k.b)
            ) item_sales 
  ) item_rank
where rnk <=  3;
{noformat}

Workaround is to {{set hive.ppd.remove.duplicatefilters=false;}} 
It seems that Hive is too agressive in pushing filters. In this particular case 
filter (rnk <= 3) gets pushed over PTFOperator and then this filter tries to 
reference column (rnk) which infact is generated by PTFOperator. We need to 
make this filter cannot be pushed over PTFOperator.
                
> Incorrect column mappings with over clause
> ------------------------------------------
>
>                 Key: HIVE-4143
>                 URL: https://issues.apache.org/jira/browse/HIVE-4143
>             Project: Hive
>          Issue Type: Bug
>          Components: PTF-Windowing
>            Reporter: Ashutosh Chauhan
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to