From 856ade78dddd32b41afdb56657c4b28451338831 Mon Sep 17 00:00:00 2001 From: RaigorJiang Date: Tue, 7 Nov 2023 16:03:39 +0800 Subject: [PATCH] Use enum to replace string keys. --- .../distsql/ral/queryable/ShowDistVariablesExecutor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutor.java index 961984a0b899e..4e98e446f07ec 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutor.java @@ -51,7 +51,8 @@ public Collection getColumnNames() { @Override public Collection getRows(final ShardingSphereMetaData metaData, final ConnectionSession connectionSession, final ShowDistVariablesStatement sqlStatement) { - Collection result = ConfigurationPropertyKey.getKeyNames().stream().filter(each -> !"sql_show".equalsIgnoreCase(each) && !"sql_simple".equalsIgnoreCase(each)) + Collection result = ConfigurationPropertyKey.getKeyNames().stream() + .filter(each -> !ConfigurationPropertyKey.SQL_SHOW.name().equalsIgnoreCase(each) && !ConfigurationPropertyKey.SQL_SIMPLE.name().equalsIgnoreCase(each)) .map(each -> new LocalDataQueryResultRow(each.toLowerCase(), getStringResult(metaData.getProps().getValue(ConfigurationPropertyKey.valueOf(each))))).collect(Collectors.toList()); result.addAll(TemporaryConfigurationPropertyKey.getKeyNames().stream() .map(each -> new LocalDataQueryResultRow(each.toLowerCase(), getStringResult(metaData.getTemporaryProps().getValue(TemporaryConfigurationPropertyKey.valueOf(each)))))