[ https://issues.apache.org/jira/browse/HIVE-7063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14046699#comment-14046699 ]
Harish Butani commented on HIVE-7063: ------------------------------------- Yes, in your case we can optimize as though 'rank < 5' was specified. Though I cannot see a valid use case of writing a limit after a windowing expression, as you point out the more common case is a predicate on rank. > Optimize for the Top N within a Group use case > ---------------------------------------------- > > Key: HIVE-7063 > URL: https://issues.apache.org/jira/browse/HIVE-7063 > Project: Hive > Issue Type: Bug > Reporter: Harish Butani > Assignee: Harish Butani > Attachments: HIVE-7063.1.patch, HIVE-7063.2.patch > > > It is common to rank within a Group/Partition and then only return the Top N > entries within each Group. > With Streaming mode for Windowing, we should push the post filter on the rank > into the Windowing processing as a Limit expression. -- This message was sent by Atlassian JIRA (v6.2#6252)