From f9ddb6c7e853ad1559dd534ce01fc147a887bf0a Mon Sep 17 00:00:00 2001 From: Murphy <96611012+murphyatwork@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:03:05 +0800 Subject: [PATCH] [Refactor] remove useless function checkCanPrune (#52441) Signed-off-by: Murphy (cherry picked from commit b61ce7908e6f4c2ee8ee85ea048a230e09e8128e) --- .../rule/tree/PruneComplexTypeUtil.java | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rule/tree/PruneComplexTypeUtil.java b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rule/tree/PruneComplexTypeUtil.java index 4ab1a83a76daf..7065f555f8dd3 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rule/tree/PruneComplexTypeUtil.java +++ b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rule/tree/PruneComplexTypeUtil.java @@ -103,13 +103,6 @@ public void addAccessPaths(ColumnRefOperator columnRefOperator, } public void add(ColumnRefOperator outputColumnRefOperator, ScalarOperator scalarOperator) { - // If outputColumnRefOperator's type is not equal to scalarOperator's type, - // we just stop pruning in case. - if (!checkCanPrune(outputColumnRefOperator, scalarOperator)) { - setEnablePruneComplexTypes(false); - return; - } - ComplexTypeAccessGroup visitedAccessGroup = null; if (outputColumnRefOperator != null) { // If outputColumnRefOperator is not null, it means it may have visited access group, @@ -158,22 +151,6 @@ private ColumnRefOperator getOriginalColRef(ColumnRefOperator col) { return col; } - private boolean checkCanPrune(ColumnRefOperator columnRefOperator, ScalarOperator scalarOperator) { - if (columnRefOperator == null) { - return true; - } - - if (!columnRefOperator.getType().isComplexType() && !scalarOperator.getType().isComplexType()) { - // If columnRefOperator and scalarOperator both are not complex type, don't need to check - return true; - } - - if (!columnRefOperator.getType().equals(scalarOperator.getType())) { - LOG.warn(String.format("Complex type columnRefOperator[%s] and scalarOperator[%s] should has the same " + - "type", columnRefOperator.getType(), scalarOperator.getType())); - } - return true; - } } private static ComplexTypeAccessPaths concatAccessPaths(