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

Jesus Camacho Rodriguez edited comment on HIVE-20150 at 7/12/18 2:35 PM:
-------------------------------------------------------------------------

It seems to me initial implementation should support at least:
- Push through Project if expression(s) in TopNKey can be mapped to 
expression(s) based on Project input.
- Push through GroupBy. No grouping sets. If TopNKey expression is same as 
GroupBy expression, we can push it and remove it from above GroupBy. If 
expression in TopNKey shared common prefix with GroupBy, TopNKey could be 
pushed through GroupBy using that prefix and kept above it.
- Push through ReduceSink. If TopNKey expression is same as ReduceSink 
expression and order is the same, we can push it and remove it from above 
ReduceSink. If expression in TopNKey shared common prefix with ReduceSink 
including same order, TopNKey could be pushed through ReduceSink using that 
prefix and kept above it.
- Push through FOJ. Push TopNKey expression without keys to largest input. Keep 
on top of FOJ.
- Push through LOJ. If TopNKey expression refers fully to expressions from left 
input, push with rewriting of expressions and remove from top of LOJ. If 
TopNKey expression has a prefix that refers to expressions from left input, 
push with rewriting of those expressions and keep on top of LOJ.
- Push through ROJ. Same as for LOJ, but change left to right.

[~gopalv], thoughts? Does it seem correct? Should we consider any other for the 
minimum implementation?


was (Author: jcamachorodriguez):
It seems to me initial implementation should support at least:
- Push through Project if expression(s) in TopNKey can be mapped to 
expression(s) based on Project input.
- Push through GroupBy. No grouping sets. If TopNKey expression is same as 
GroupBy expression, we can push it and remove it from above GroupBy. If 
expression in TopNKey shared common prefix with GroupBy, TopNKey could be 
pushed through GroupBy using that prefix and kept above it.
- Push through ReduceSink. If TopNKey expression is same as ReduceSink 
expression and order is the same, we can push it and remove it from above 
ReduceSink. If expression in TopNKey shared common prefix with ReduceSink 
including same order, TopNKey could be pushed through ReduceSink using that 
prefix and kept above it.
- Push through FOJ. Push TopNKey expression without keys to largest input. Keep 
on top of FOJ.
- Push through LOJ. If TopNKey expression refers fully to expressions from left 
input, push with rewriting of expressions and remove from top of LOJ. If 
TopNKey expression has a prefix that refers to expressions from left input, 
push with rewriting of those expressions and keep on top of LOJ.
- Push through ROJ. Same as for LOJ, but change left to right.
[~gopalv], thoughts? Does it seem correct? Should we consider any other for the 
minimum implementation?

> TopNKey pushdown
> ----------------
>
>                 Key: HIVE-20150
>                 URL: https://issues.apache.org/jira/browse/HIVE-20150
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Teddy Choi
>            Assignee: Teddy Choi
>            Priority: Major
>
> TopNKey operator is implemented in HIVE-17896, but it needs more work in 
> pushdown implementation. So this issue covers TopNKey pushdown implementation 
> with proper tests.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to