Skip to content

Commit

Permalink
[Refactor] remove useless function checkCanPrune (backport #52441) (#…
Browse files Browse the repository at this point in the history
…52444)

Co-authored-by: Murphy <[email protected]>
  • Loading branch information
mergify[bot] and murphyatwork authored Oct 29, 2024
1 parent dea8203 commit dcd3144
Showing 1 changed file with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit dcd3144

Please sign in to comment.