From b8494008adff96e83ed953bb256f2713596a0eaa Mon Sep 17 00:00:00 2001 From: null <466144425@qq.com> Date: Tue, 15 Oct 2019 11:51:12 +0800 Subject: [PATCH] refine DerviedColumn method which is dependent on the core path of query (#3268) --- .../segment/select/projection/DerivedColumn.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sharding-core/sharding-core-preprocessor/src/main/java/org/apache/shardingsphere/core/preprocessor/segment/select/projection/DerivedColumn.java b/sharding-core/sharding-core-preprocessor/src/main/java/org/apache/shardingsphere/core/preprocessor/segment/select/projection/DerivedColumn.java index feaff660ee..67cbea90a0 100644 --- a/sharding-core/sharding-core-preprocessor/src/main/java/org/apache/shardingsphere/core/preprocessor/segment/select/projection/DerivedColumn.java +++ b/sharding-core/sharding-core-preprocessor/src/main/java/org/apache/shardingsphere/core/preprocessor/segment/select/projection/DerivedColumn.java @@ -37,7 +37,9 @@ public enum DerivedColumn { ORDER_BY_ALIAS("ORDER_BY_DERIVED_"), GROUP_BY_ALIAS("GROUP_BY_DERIVED_"), AGGREGATION_DISTINCT_DERIVED("AGGREGATION_DISTINCT_DERIVED_"); - + + private static final Collection VALUES_WITHOUT_AGGREGATION_DISTINCT_DERIVED = getValues(); + private final String pattern; /** @@ -72,7 +74,7 @@ public enum DerivedColumn { * @return is derived column or not */ public static boolean isDerivedColumn(final String columnName) { - for (DerivedColumn each : DerivedColumn.getValues()) { + for (DerivedColumn each : VALUES_WITHOUT_AGGREGATION_DISTINCT_DERIVED) { if (columnName.startsWith(each.pattern)) { return true; } -- GitLab