From 8c81b8a4fe2e728fa3b742ea4f17f252eff3ead6 Mon Sep 17 00:00:00 2001 From: Zenglin Luo Date: Sat, 7 Jan 2023 10:47:45 +0800 Subject: [PATCH] [fix](predicate) fix be core dump caused by pushing down the double column predicate --- .../main/java/org/apache/doris/planner/OriginalPlanner.java | 3 ++- .../sql_functions/string_functions/test_split_part.out | 5 +++++ .../sql_functions/string_functions/test_split_part.groovy | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 regression-test/data/query_p0/sql_functions/string_functions/test_split_part.out diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/OriginalPlanner.java b/fe/fe-core/src/main/java/org/apache/doris/planner/OriginalPlanner.java index c2c15c5c31da00..a5472959b3e6fa 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/OriginalPlanner.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/OriginalPlanner.java @@ -382,7 +382,8 @@ private void checkTopnOpt(PlanNode node) { if (child instanceof OlapScanNode && sortNode.getLimit() > 0 && sortNode.getSortInfo().getMaterializedOrderingExprs().size() > 0) { Expr firstSortExpr = sortNode.getSortInfo().getMaterializedOrderingExprs().get(0); - if (firstSortExpr instanceof SlotRef && !firstSortExpr.getType().isStringType()) { + if (firstSortExpr instanceof SlotRef && !firstSortExpr.getType().isStringType() + && !firstSortExpr.getType().isFloatingPointType()) { OlapScanNode scanNode = (OlapScanNode) child; sortNode.setUseTopnOpt(true); scanNode.setUseTopnOpt(true); diff --git a/regression-test/data/query_p0/sql_functions/string_functions/test_split_part.out b/regression-test/data/query_p0/sql_functions/string_functions/test_split_part.out new file mode 100644 index 00000000000000..02bb117d12d44d --- /dev/null +++ b/regression-test/data/query_p0/sql_functions/string_functions/test_split_part.out @@ -0,0 +1,5 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !1 -- +0. 0.1 0. +\N 20.268 20.268 + diff --git a/regression-test/suites/query_p0/sql_functions/string_functions/test_split_part.groovy b/regression-test/suites/query_p0/sql_functions/string_functions/test_split_part.groovy index 9b15ffb68692dc..dda044e34a3773 100644 --- a/regression-test/suites/query_p0/sql_functions/string_functions/test_split_part.groovy +++ b/regression-test/suites/query_p0/sql_functions/string_functions/test_split_part.groovy @@ -27,4 +27,6 @@ suite("test_split_part") { """ exception "[RUNTIME_ERROR]Argument at index 3 for function split_part must be constant" } + + qt_1 "select split_part(k8, '1', 1), k8, split_part(concat(k8, '12'), '1', 1) from test_query_db.test order by k8 limit 2;" } \ No newline at end of file