Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push PARTIAL TopN into table scan #7563

Merged
merged 3 commits into from
Apr 14, 2021

Conversation

losipiuk
Copy link
Member

@losipiuk losipiuk commented Apr 12, 2021

fixes #7028

@cla-bot cla-bot bot added the cla-signed label Apr 12, 2021
@losipiuk losipiuk force-pushed the lo/partial-topn-pushdown branch from 69fdab7 to af7373a Compare April 12, 2021 14:44
@losipiuk losipiuk marked this pull request as ready for review April 12, 2021 14:44
@losipiuk losipiuk requested review from findepi and wendigo April 12, 2021 14:44
private static final Pattern<TopNNode> PATTERN = topN()
.matching(node -> node.getStep().equals(Step.SINGLE))
.matching(node -> EnumSet.of(Step.SINGLE, Step.PARTIAL).contains(node.getStep()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment at

return metadata.applyTopN(context.getSession(), tableScan.getTable(), topNCount, sortItems, assignments)
.map(result -> {
PlanNode node = TableScanNode.newInstance(
capturing the some reasoning (or a hint that there was a reasoning) why removing PARTIAL TopN, while leaving FINAL TopN in the plan, is an OK thing to do

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added sth

@losipiuk losipiuk force-pushed the lo/partial-topn-pushdown branch from af7373a to c5e6712 Compare April 13, 2021 12:51
@losipiuk
Copy link
Member Author

AC

@losipiuk
Copy link
Member Author

CI: #7559

@losipiuk losipiuk merged commit 98fbb58 into trinodb:master Apr 14, 2021
@losipiuk losipiuk added this to the 356 milestone Apr 14, 2021
@losipiuk losipiuk mentioned this pull request Apr 14, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Push PARTIAL TopN into TableScan
2 participants