You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2023/06/28 10:59:46 UTC
[shardingsphere] branch master updated: Table names in SQLFederationSchema are adjusted to lowercase (#26660)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 b26ca6ebfb8 Table names in SQLFederationSchema are adjusted to lowercase (#26660)
b26ca6ebfb8 is described below
commit b26ca6ebfb86c56cb755115dfcc16a33138cfe7b
Author: jiangML <10...@qq.com>
AuthorDate: Wed Jun 28 18:59:35 2023 +0800
Table names in SQLFederationSchema are adjusted to lowercase (#26660)
---
.../sqlfederation/compiler/metadata/schema/SQLFederationSchema.java | 4 ++--
.../executor/enumerable/EnumerablePushDownTableScanExecutor.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationSchema.java b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationSchema.java
index e88397d3c11..44d48a66909 100644
--- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationSchema.java
+++ b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationSchema.java
@@ -54,10 +54,10 @@ public final class SQLFederationSchema extends AbstractSchema {
Map<String, Table> result = new LinkedHashMap<>(schema.getTables().size(), 1F);
for (ShardingSphereTable each : schema.getTables().values()) {
if (schema.containsView(each.getName())) {
- result.put(each.getName(), getViewTable(schema, each, protocolType, javaTypeFactory));
+ result.put(each.getName().toLowerCase(), getViewTable(schema, each, protocolType, javaTypeFactory));
} else {
// TODO implement table statistic logic after using custom operators
- result.put(each.getName(), new SQLFederationTable(each, new SQLFederationStatistic(), protocolType));
+ result.put(each.getName().toLowerCase(), new SQLFederationTable(each, new SQLFederationStatistic(), protocolType));
}
}
return result;
diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerablePushDownTableScanExecutor.java b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerablePushDownTableScanExecutor.java
index 5573393ecad..e11d4c97b12 100644
--- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerablePushDownTableScanExecutor.java
+++ b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerablePushDownTableScanExecutor.java
@@ -193,7 +193,7 @@ public final class EnumerablePushDownTableScanExecutor {
return createMemoryScalarEnumerator(createSystemCatalogTableData(table, projects));
}
Optional<ShardingSphereTableData> tableData = Optional.ofNullable(statistics.getDatabaseData().get(databaseName)).map(optional -> optional.getSchemaData().get(schemaName))
- .map(ShardingSphereSchemaData::getTableData).map(shardingSphereData -> shardingSphereData.get(table.getName()));
+ .map(optional -> optional.getTable(table.getName()));
return tableData.map(this::createMemoryScalarEnumerator).orElseGet(this::createEmptyScalarEnumerable);
}