Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Sep 9, 2024
1 parent 5ebb010 commit 048b9d4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,17 @@ public Boolean visitPhysicalNestedLoopJoin(PhysicalNestedLoopJoin<? extends Plan
public Boolean visitPhysicalRelation(PhysicalRelation relation, PushDownContext ctx) {
if (supportPhysicalRelations(relation)
&& relation.getOutputSet().containsAll(ctx.probeExpr.getInputSlots())) {
if (relation.getStats().getRowCount() > ctx.topn.getLimit() + ctx.topn.getOffset()) {
// in ut, relation.getStats() may return null
if (relation.getStats() == null
|| relation.getStats().getRowCount() > ctx.topn.getLimit() + ctx.topn.getOffset()) {
topnFilterContext.addTopnFilter(ctx.topn, relation, ctx.probeExpr);
return true;
}
}
return false;
}


private boolean supportPhysicalRelations(PhysicalRelation relation) {
return relation instanceof PhysicalOlapScan
|| relation instanceof PhysicalOdbcScan
Expand Down

0 comments on commit 048b9d4

Please sign in to comment.