This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 2b2f4bed42f Remove the usage of Validate.isTrue method to avoid
unnecessary construction of string (#10143)
2b2f4bed42f is described below
commit 2b2f4bed42fda8d0b587bea70ec1bd9083f115a8
Author: Beyyes <[email protected]>
AuthorDate: Wed Jun 14 13:56:42 2023 +0800
Remove the usage of Validate.isTrue method to avoid unnecessary
construction of string (#10143)
---
.../iotdb/db/mpp/plan/planner/LogicalPlanVisitor.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanVisitor.java
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanVisitor.java
index ecda02923eb..8f63b6905b7 100644
---
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanVisitor.java
+++
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanVisitor.java
@@ -83,8 +83,6 @@ import
org.apache.iotdb.db.mpp.plan.statement.metadata.view.ShowLogicalViewState
import org.apache.iotdb.db.mpp.plan.statement.sys.ShowQueriesStatement;
import org.apache.iotdb.tsfile.utils.Pair;
-import org.apache.commons.lang3.Validate;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -346,12 +344,14 @@ public class LogicalPlanVisitor extends
StatementVisitor<PlanNode, MPPQueryConte
private boolean cannotUseStatistics(Set<Expression> expressions) {
for (Expression expression : expressions) {
- Validate.isTrue(
- expression instanceof FunctionExpression,
- String.format("Invalid Aggregation Expression: %s",
expression.getExpressionString()));
- if (!BuiltinAggregationFunction.canUseStatistics(
- ((FunctionExpression) expression).getFunctionName())) {
- return true;
+ if (expression instanceof FunctionExpression) {
+ if (!BuiltinAggregationFunction.canUseStatistics(
+ ((FunctionExpression) expression).getFunctionName())) {
+ return true;
+ }
+ } else {
+ throw new IllegalArgumentException(
+ String.format("Invalid Aggregation Expression: %s",
expression.getExpressionString()));
}
}
return false;