You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2023/07/05 13:33:52 UTC

[shardingsphere] branch master updated: Remove useless timezone properties in OptimizerParserContextFactory (#26780)

This is an automated email from the ASF dual-hosted git repository.

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 5bfb4da3671 Remove useless timezone properties in OptimizerParserContextFactory (#26780)
5bfb4da3671 is described below

commit 5bfb4da3671f5f44d3d01b527e1ee47e05ad28c1
Author: Zhengqiang Duan <du...@apache.org>
AuthorDate: Wed Jul 5 21:33:45 2023 +0800

    Remove useless timezone properties in OptimizerParserContextFactory (#26780)
---
 .../core/listener/ShardingSphereStatisticsScheduleCollector.java    | 5 +++--
 .../compiler/context/parser/OptimizerParserContextFactory.java      | 6 +-----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/listener/ShardingSphereStatisticsScheduleCollector.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/listener/ShardingSphereStatisticsScheduleCollector.java
index 5e82c10f60e..29663f48be2 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/listener/ShardingSphereStatisticsScheduleCollector.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/listener/ShardingSphereStatisticsScheduleCollector.java
@@ -104,8 +104,9 @@ public final class ShardingSphereStatisticsScheduleCollector {
         
         private void collectForTable(final String databaseName, final String schemaName, final ShardingSphereTable table,
                                      final Map<String, ShardingSphereDatabase> databases, final ShardingSphereStatistics statistics) {
-            String collectorType = SHARDING_SPHERE_SYSTEM_DATABASE_SCHEMA.equalsIgnoreCase(schemaName) 
-                    ? table.getName() : String.join(".", databases.get(databaseName).getProtocolType().getType(), schemaName, table.getName());
+            String collectorType = SHARDING_SPHERE_SYSTEM_DATABASE_SCHEMA.equalsIgnoreCase(schemaName)
+                    ? table.getName()
+                    : String.join(".", databases.get(databaseName).getProtocolType().getType(), schemaName, table.getName());
             Optional<ShardingSphereStatisticsCollector> dataCollector = TypedSPILoader.findService(ShardingSphereStatisticsCollector.class, collectorType);
             if (!dataCollector.isPresent()) {
                 return;
diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContextFactory.java b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContextFactory.java
index 7308b639055..09d645aebf4 100644
--- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContextFactory.java
+++ b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContextFactory.java
@@ -19,7 +19,6 @@ package org.apache.shardingsphere.sqlfederation.compiler.context.parser;
 
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
-import org.apache.calcite.config.CalciteConnectionProperty;
 import org.apache.shardingsphere.infra.database.type.DatabaseType;
 import org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
 import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
@@ -63,9 +62,6 @@ public final class OptimizerParserContextFactory {
     }
     
     private static Properties createSQLDialectProperties(final DatabaseType databaseType) {
-        Properties result = new Properties();
-        result.setProperty(CalciteConnectionProperty.TIME_ZONE.camelName(), "UTC");
-        result.putAll(TypedSPILoader.getService(OptimizerSQLDialectBuilder.class, null == databaseType ? null : databaseType.getType()).build());
-        return result;
+        return TypedSPILoader.getService(OptimizerSQLDialectBuilder.class, databaseType.getType()).build();
     }
 }