From 048b9d40d395e2e5a4b86a78e0cb9b3f3539fa66 Mon Sep 17 00:00:00 2001 From: minghong Date: Mon, 9 Sep 2024 09:47:27 +0800 Subject: [PATCH] fix --- .../nereids/processor/post/TopnFilterPushDownVisitor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/TopnFilterPushDownVisitor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/TopnFilterPushDownVisitor.java index 95cdbd9cc96af0b..a6c97cf4267741b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/TopnFilterPushDownVisitor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/TopnFilterPushDownVisitor.java @@ -218,7 +218,9 @@ public Boolean visitPhysicalNestedLoopJoin(PhysicalNestedLoopJoin 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; } @@ -226,6 +228,7 @@ public Boolean visitPhysicalRelation(PhysicalRelation relation, PushDownContext return false; } + private boolean supportPhysicalRelations(PhysicalRelation relation) { return relation instanceof PhysicalOlapScan || relation instanceof PhysicalOdbcScan