From 538373b8020c7e0304c2fc52845319ec24b2bbbe Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sun, 11 Feb 2024 15:40:39 +0800 Subject: [PATCH] Add SQLStatement parameter on DistSQLQueryExecutor.getColumnNames() (#30088) --- .../query/ShowBroadcastTableRuleExecutor.java | 2 +- .../handler/query/ShowEncryptRuleExecutor.java | 14 +++++--------- .../handler/query/ShowMaskRuleExecutor.java | 2 +- .../query/ShowReadwriteSplittingRuleExecutor.java | 2 +- ...wStatusFromReadwriteSplittingRulesExecutor.java | 2 +- .../query/ShowDefaultShadowAlgorithmExecutor.java | 2 +- .../query/ShowShadowAlgorithmsExecutor.java | 2 +- .../handler/query/ShowShadowRuleExecutor.java | 2 +- .../query/ShowShadowTableRulesExecutor.java | 2 +- .../query/ShowDefaultShardingStrategyExecutor.java | 2 +- .../query/ShowShardingAlgorithmExecutor.java | 2 +- .../query/ShowShardingAuditorsExecutor.java | 2 +- .../query/ShowShardingKeyGeneratorExecutor.java | 2 +- .../query/ShowShardingTableNodesExecutor.java | 2 +- .../ShowShardingTableReferenceRuleExecutor.java | 2 +- .../query/ShowShardingTableRuleExecutor.java | 2 +- ...howShardingTableRulesUsedAlgorithmExecutor.java | 2 +- .../ShowShardingTableRulesUsedAuditorExecutor.java | 2 +- ...ShardingTableRulesUsedKeyGeneratorExecutor.java | 2 +- .../ShowUnusedShardingAlgorithmsExecutor.java | 2 +- .../query/ShowUnusedShardingAuditorsExecutor.java | 2 +- .../ShowUnusedShardingKeyGeneratorExecutor.java | 2 +- .../engine/query/DistSQLQueryExecuteEngine.java | 3 +-- .../handler/engine/query/DistSQLQueryExecutor.java | 3 ++- .../executor/ral/plugin/ShowPluginsExecutor.java | 2 +- .../rql/resource/ShowLogicalTableExecutor.java | 2 +- .../resource/ShowRulesUsedStorageUnitExecutor.java | 2 +- .../rql/resource/ShowStorageUnitExecutor.java | 2 +- .../executor/rql/rule/RuleCountExecutor.java | 2 +- .../handler/query/ShowAuthorityRuleExecutor.java | 2 +- .../query/ShowStreamingJobStatusExecutor.java | 2 +- .../handler/query/ShowStreamingListExecutor.java | 2 +- .../handler/query/ShowStreamingRuleExecutor.java | 2 +- .../ShowMigrationCheckAlgorithmsExecutor.java | 2 +- .../query/ShowMigrationCheckStatusExecutor.java | 2 +- .../query/ShowMigrationJobStatusExecutor.java | 2 +- .../handler/query/ShowMigrationListExecutor.java | 2 +- .../ShowMigrationSourceStorageUnitsExecutor.java | 2 +- .../handler/query/ShowGlobalClockRuleExecutor.java | 2 +- .../ShowDefaultSingleTableStorageUnitExecutor.java | 2 +- .../handler/query/ShowSingleTableExecutor.java | 2 +- .../query/ShowUnloadedSingleTableExecutor.java | 2 +- .../query/ShowSQLFederationRuleExecutor.java | 2 +- .../handler/query/ShowSQLParserRuleExecutor.java | 2 +- .../query/ShowSQLTranslatorRuleExecutor.java | 2 +- .../handler/query/ShowTrafficRuleExecutor.java | 2 +- .../handler/query/ShowTransactionRuleExecutor.java | 2 +- .../ConvertYamlConfigurationExecutor.java | 2 +- .../ExportDatabaseConfigurationExecutor.java | 2 +- .../ral/queryable/ExportMetaDataExecutor.java | 2 +- .../ral/queryable/ExportStorageNodesExecutor.java | 2 +- .../ral/queryable/ShowComputeNodeInfoExecutor.java | 2 +- .../ral/queryable/ShowComputeNodeModeExecutor.java | 2 +- .../ral/queryable/ShowComputeNodesExecutor.java | 2 +- .../ral/queryable/ShowDistVariableExecutor.java | 2 +- .../ral/queryable/ShowDistVariablesExecutor.java | 2 +- .../ral/queryable/ShowMigrationRuleExecutor.java | 2 +- .../ral/queryable/ShowTableMetaDataExecutor.java | 2 +- .../handler/distsql/rul/FormatSQLExecutor.java | 2 +- .../handler/distsql/rul/ParseDistSQLExecutor.java | 2 +- .../handler/distsql/rul/PreviewExecutor.java | 2 +- 61 files changed, 66 insertions(+), 70 deletions(-) diff --git a/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/query/ShowBroadcastTableRuleExecutor.java b/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/query/ShowBroadcastTableRuleExecutor.java index dcd057dfa34ff..ec4a689e75a1a 100644 --- a/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/query/ShowBroadcastTableRuleExecutor.java +++ b/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/query/ShowBroadcastTableRuleExecutor.java @@ -38,7 +38,7 @@ public final class ShowBroadcastTableRuleExecutor implements DistSQLQueryExecuto private BroadcastRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowBroadcastTableRulesStatement sqlStatement) { return Collections.singleton("broadcast_table"); } diff --git a/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java b/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java index bcf9a4a44a720..2be2e6b161cd3 100644 --- a/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java +++ b/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java @@ -46,7 +46,7 @@ public final class ShowEncryptRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowEncryptRulesStatement sqlStatement) { return Arrays.asList("table", "logic_column", "cipher_column", "assisted_query_column", "like_query_column", "encryptor_type", "encryptor_props", "assisted_query_type", "assisted_query_props", "like_query_type", "like_query_props"); } @@ -76,18 +76,14 @@ private Collection buildColumnData(final EncryptTableRu each.getLikeQuery().map(EncryptColumnItemRuleConfiguration::getName).orElse(""), encryptorAlgorithmConfig.getType(), PropertiesConverter.convert(encryptorAlgorithmConfig.getProps()), - null == assistedQueryEncryptorAlgorithmConfig ? nullToEmptyString(null) : assistedQueryEncryptorAlgorithmConfig.getType(), - null == assistedQueryEncryptorAlgorithmConfig ? nullToEmptyString(null) : PropertiesConverter.convert(assistedQueryEncryptorAlgorithmConfig.getProps()), - null == likeQueryEncryptorAlgorithmConfig ? nullToEmptyString(null) : likeQueryEncryptorAlgorithmConfig.getType(), - null == likeQueryEncryptorAlgorithmConfig ? nullToEmptyString(null) : PropertiesConverter.convert(likeQueryEncryptorAlgorithmConfig.getProps())))); + null == assistedQueryEncryptorAlgorithmConfig ? "" : assistedQueryEncryptorAlgorithmConfig.getType(), + null == assistedQueryEncryptorAlgorithmConfig ? "" : PropertiesConverter.convert(assistedQueryEncryptorAlgorithmConfig.getProps()), + null == likeQueryEncryptorAlgorithmConfig ? "" : likeQueryEncryptorAlgorithmConfig.getType(), + null == likeQueryEncryptorAlgorithmConfig ? "" : PropertiesConverter.convert(likeQueryEncryptorAlgorithmConfig.getProps())))); } return result; } - private Object nullToEmptyString(final Object obj) { - return null == obj ? "" : obj; - } - @Override public Class getRuleClass() { return EncryptRule.class; diff --git a/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java b/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java index 791119bb4246a..4d67ed9d6d2c9 100644 --- a/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java +++ b/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java @@ -43,7 +43,7 @@ public final class ShowMaskRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowMaskRulesStatement sqlStatement) { return Arrays.asList("table", "column", "algorithm_type", "algorithm_props"); } diff --git a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java index 88165ab543b86..17936eb1b785f 100644 --- a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java +++ b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java @@ -48,7 +48,7 @@ public final class ShowReadwriteSplittingRuleExecutor implements DistSQLQueryExe private ReadwriteSplittingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowReadwriteSplittingRulesStatement sqlStatement) { return Arrays.asList("name", "write_storage_unit_name", "read_storage_unit_names", "transactional_read_query_strategy", "load_balancer_type", "load_balancer_props"); } diff --git a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowStatusFromReadwriteSplittingRulesExecutor.java b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowStatusFromReadwriteSplittingRulesExecutor.java index 6092231b2d580..54f9074410a06 100644 --- a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowStatusFromReadwriteSplittingRulesExecutor.java +++ b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowStatusFromReadwriteSplittingRulesExecutor.java @@ -56,7 +56,7 @@ public final class ShowStatusFromReadwriteSplittingRulesExecutor implements Dist private ShardingSphereDatabase database; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowStatusFromReadwriteSplittingRulesStatement sqlStatement) { return Arrays.asList("storage_unit", "status"); } diff --git a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java index 09cf73cdead47..b9b8b2a698c96 100644 --- a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java +++ b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java @@ -43,7 +43,7 @@ public final class ShowDefaultShadowAlgorithmExecutor implements DistSQLQueryExe private ShadowRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowDefaultShadowAlgorithmStatement sqlStatement) { return Arrays.asList("shadow_algorithm_name", "type", "props"); } diff --git a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java index 53b44016845a1..bcf54dd25dda3 100644 --- a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java +++ b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java @@ -40,7 +40,7 @@ public final class ShowShadowAlgorithmsExecutor implements DistSQLQueryExecutor< private ShadowRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShadowAlgorithmsStatement sqlStatement) { return Arrays.asList("shadow_algorithm_name", "type", "props", "is_default"); } diff --git a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java index ab4e4cd793ec8..74cfce2f32409 100644 --- a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java +++ b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java @@ -46,7 +46,7 @@ public final class ShowShadowRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowShadowRulesStatement sqlStatement) { return Arrays.asList("shadow_table", "rule_name", "source_name", "shadow_name", "algorithm_type", "algorithm_props"); } diff --git a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowTableRulesExecutor.java b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowTableRulesExecutor.java index 94e5beb7b1994..403ed34215868 100644 --- a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowTableRulesExecutor.java +++ b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowTableRulesExecutor.java @@ -46,7 +46,7 @@ public final class ShowShadowTableRulesExecutor implements DistSQLQueryExecutor< private ShadowRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShadowTableRulesStatement sqlStatement) { return Arrays.asList(SHADOW_TABLE, SHADOW_ALGORITHM_NAME); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowDefaultShardingStrategyExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowDefaultShardingStrategyExecutor.java index a79012fa7a157..84f319a5b41f2 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowDefaultShardingStrategyExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowDefaultShardingStrategyExecutor.java @@ -43,7 +43,7 @@ public final class ShowDefaultShardingStrategyExecutor implements DistSQLQueryEx private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowDefaultShardingStrategyStatement sqlStatement) { return Arrays.asList("name", "type", "sharding_column", "sharding_algorithm_name", "sharding_algorithm_type", "sharding_algorithm_props"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java index 77e7fb11d9b51..549d7a8ee02f3 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java @@ -40,7 +40,7 @@ public final class ShowShardingAlgorithmExecutor implements DistSQLQueryExecutor private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShardingAlgorithmsStatement sqlStatement) { return Arrays.asList("name", "type", "props"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAuditorsExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAuditorsExecutor.java index 97f50c6a6586d..a5b2fcec18416 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAuditorsExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAuditorsExecutor.java @@ -39,7 +39,7 @@ public final class ShowShardingAuditorsExecutor implements DistSQLQueryExecutor< private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShardingAuditorsStatement sqlStatement) { return Arrays.asList("name", "type", "props"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingKeyGeneratorExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingKeyGeneratorExecutor.java index 19a73355c43f3..daeda4c0f5479 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingKeyGeneratorExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingKeyGeneratorExecutor.java @@ -39,7 +39,7 @@ public final class ShowShardingKeyGeneratorExecutor implements DistSQLQueryExecu private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShardingKeyGeneratorsStatement sqlStatement) { return Arrays.asList("name", "type", "props"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutor.java index e6aefc7ae5df8..574a9c0e966d7 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutor.java @@ -41,7 +41,7 @@ public final class ShowShardingTableNodesExecutor implements DistSQLQueryExecuto private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShardingTableNodesStatement sqlStatement) { return Arrays.asList("name", "nodes"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableReferenceRuleExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableReferenceRuleExecutor.java index b6ab3c6f277c4..aebeea76e2cc7 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableReferenceRuleExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableReferenceRuleExecutor.java @@ -38,7 +38,7 @@ public final class ShowShardingTableReferenceRuleExecutor implements DistSQLQuer private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShardingTableReferenceRulesStatement sqlStatement) { return Arrays.asList("name", "sharding_table_reference"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRuleExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRuleExecutor.java index 5fa117bfc62b9..87d4f50581126 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRuleExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRuleExecutor.java @@ -51,7 +51,7 @@ public final class ShowShardingTableRuleExecutor implements DistSQLQueryExecutor private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShardingTableRulesStatement sqlStatement) { return Arrays.asList("table", "actual_data_nodes", "actual_data_sources", "database_strategy_type", "database_sharding_column", "database_sharding_algorithm_type", "database_sharding_algorithm_props", "table_strategy_type", "table_sharding_column", "table_sharding_algorithm_type", "table_sharding_algorithm_props", "key_generate_column", "key_generator_type", "key_generator_props", "auditor_types", "allow_hint_disable"); diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedAlgorithmExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedAlgorithmExecutor.java index ba1600f1223e1..f8b9f2dc2b340 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedAlgorithmExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedAlgorithmExecutor.java @@ -41,7 +41,7 @@ public final class ShowShardingTableRulesUsedAlgorithmExecutor implements DistSQ private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShardingTableRulesUsedAlgorithmStatement sqlStatement) { return Arrays.asList("type", "name"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedAuditorExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedAuditorExecutor.java index 70a11bce2780e..fdbbf3fa48dcf 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedAuditorExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedAuditorExecutor.java @@ -39,7 +39,7 @@ public final class ShowShardingTableRulesUsedAuditorExecutor implements DistSQLQ private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShardingTableRulesUsedAuditorStatement sqlStatement) { return Arrays.asList("type", "name"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedKeyGeneratorExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedKeyGeneratorExecutor.java index 02ac8893aae3e..7f29031fb3568 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedKeyGeneratorExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRulesUsedKeyGeneratorExecutor.java @@ -39,7 +39,7 @@ public final class ShowShardingTableRulesUsedKeyGeneratorExecutor implements Dis private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowShardingTableRulesUsedKeyGeneratorStatement sqlStatement) { return Arrays.asList("type", "name"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java index f97e4ffb8535d..b30f7567a0fc2 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java @@ -46,7 +46,7 @@ public final class ShowUnusedShardingAlgorithmsExecutor implements DistSQLQueryE private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowUnusedShardingAlgorithmsStatement sqlStatement) { return Arrays.asList("name", "type", "props"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAuditorsExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAuditorsExecutor.java index 800eab9364894..69573a847619e 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAuditorsExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAuditorsExecutor.java @@ -42,7 +42,7 @@ public final class ShowUnusedShardingAuditorsExecutor implements DistSQLQueryExe private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowUnusedShardingAuditorsStatement sqlStatement) { return Arrays.asList("name", "type", "props"); } diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java index 4b486fc36dc17..39142de021bba 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java @@ -44,7 +44,7 @@ public final class ShowUnusedShardingKeyGeneratorExecutor implements DistSQLQuer private ShardingRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowUnusedShardingKeyGeneratorsStatement sqlStatement) { return Arrays.asList("name", "type", "props"); } diff --git a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/engine/query/DistSQLQueryExecuteEngine.java b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/engine/query/DistSQLQueryExecuteEngine.java index bce23b6065568..8cce66e274658 100644 --- a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/engine/query/DistSQLQueryExecuteEngine.java +++ b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/engine/query/DistSQLQueryExecuteEngine.java @@ -66,14 +66,13 @@ public DistSQLQueryExecuteEngine(final DistSQLStatement sqlStatement, final Stri @SuppressWarnings("unchecked") public void executeQuery() throws SQLException { DistSQLQueryExecutor executor = TypedSPILoader.getService(DistSQLQueryExecutor.class, sqlStatement.getClass()); + columnNames = executor.getColumnNames(sqlStatement); try { new DistSQLExecutorAwareSetter(executor).set(contextManager, null == databaseName ? null : contextManager.getDatabase(databaseName), distsqlConnectionContext); } catch (final UnsupportedSQLOperationException ignored) { rows = Collections.emptyList(); - columnNames = executor.getColumnNames(); return; } rows = executor.getRows(sqlStatement, contextManager); - columnNames = executor.getColumnNames(); } } diff --git a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/engine/query/DistSQLQueryExecutor.java b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/engine/query/DistSQLQueryExecutor.java index 1ee26a10921aa..ebf5df0875d56 100644 --- a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/engine/query/DistSQLQueryExecutor.java +++ b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/engine/query/DistSQLQueryExecutor.java @@ -37,9 +37,10 @@ public interface DistSQLQueryExecutor extends TypedS /** * Get column names. * + * @param sqlStatement DistSQL statement * @return column names */ - Collection getColumnNames(); + Collection getColumnNames(T sqlStatement); /** * Get query result rows. diff --git a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/ShowPluginsExecutor.java b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/ShowPluginsExecutor.java index f9bec2a12b471..a64f86194c527 100644 --- a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/ShowPluginsExecutor.java +++ b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/ShowPluginsExecutor.java @@ -33,7 +33,7 @@ public final class ShowPluginsExecutor implements DistSQLQueryExecutor { @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowPluginsStatement sqlStatement) { return Arrays.asList("type", "type_aliases", "description"); } diff --git a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowLogicalTableExecutor.java b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowLogicalTableExecutor.java index 5bfadebb54917..82ad985724597 100644 --- a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowLogicalTableExecutor.java +++ b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowLogicalTableExecutor.java @@ -42,7 +42,7 @@ public final class ShowLogicalTableExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowLogicalTablesStatement sqlStatement) { return Collections.singleton("table_name"); } diff --git a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowRulesUsedStorageUnitExecutor.java b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowRulesUsedStorageUnitExecutor.java index 9b275ed46ccaa..ecaab9b2cee55 100644 --- a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowRulesUsedStorageUnitExecutor.java +++ b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowRulesUsedStorageUnitExecutor.java @@ -43,7 +43,7 @@ public final class ShowRulesUsedStorageUnitExecutor implements DistSQLQueryExecu private ShardingSphereDatabase database; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowRulesUsedStorageUnitStatement sqlStatement) { return Arrays.asList("type", "name"); } diff --git a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowStorageUnitExecutor.java b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowStorageUnitExecutor.java index 67fb6c23d87fb..df1862bf46770 100644 --- a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowStorageUnitExecutor.java +++ b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/resource/ShowStorageUnitExecutor.java @@ -52,7 +52,7 @@ public final class ShowStorageUnitExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowStorageUnitsStatement sqlStatement) { return Arrays.asList("name", "type", "host", "port", "db", "connection_timeout_milliseconds", "idle_timeout_milliseconds", "max_lifetime_milliseconds", "max_pool_size", "min_pool_size", "read_only", "other_attributes"); } diff --git a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/rule/RuleCountExecutor.java b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/rule/RuleCountExecutor.java index 03ec23b3a9b3d..9b68d6d9b6930 100644 --- a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/rule/RuleCountExecutor.java +++ b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rql/rule/RuleCountExecutor.java @@ -41,7 +41,7 @@ public final class RuleCountExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final CountRuleStatement sqlStatement) { return Arrays.asList("rule_name", "database", "count"); } diff --git a/kernel/authority/distsql/handler/src/main/java/org/apache/shardingsphere/authority/distsql/handler/query/ShowAuthorityRuleExecutor.java b/kernel/authority/distsql/handler/src/main/java/org/apache/shardingsphere/authority/distsql/handler/query/ShowAuthorityRuleExecutor.java index 220c5331fa4bc..37b7cc2b579de 100644 --- a/kernel/authority/distsql/handler/src/main/java/org/apache/shardingsphere/authority/distsql/handler/query/ShowAuthorityRuleExecutor.java +++ b/kernel/authority/distsql/handler/src/main/java/org/apache/shardingsphere/authority/distsql/handler/query/ShowAuthorityRuleExecutor.java @@ -40,7 +40,7 @@ public final class ShowAuthorityRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowAuthorityRuleStatement sqlStatement) { return Arrays.asList("users", "provider", "props"); } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingJobStatusExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingJobStatusExecutor.java index 5670bebfc6290..eaadf377c271f 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingJobStatusExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingJobStatusExecutor.java @@ -41,7 +41,7 @@ public final class ShowStreamingJobStatusExecutor implements DistSQLQueryExecuto private final CDCJobAPI jobAPI = (CDCJobAPI) TypedSPILoader.getService(TransmissionJobAPI.class, "STREAMING"); @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowStreamingStatusStatement sqlStatement) { return Arrays.asList("item", "data_source", "status", "active", "processed_records_count", "inventory_finished_percentage", "incremental_idle_seconds", "confirmed_position", "current_position", "error_message"); } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingListExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingListExecutor.java index c49490748a1f2..ef03fbc8b4b4d 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingListExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingListExecutor.java @@ -39,7 +39,7 @@ public final class ShowStreamingListExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowStreamingListStatement sqlStatement) { return Arrays.asList("id", "database", "tables", "job_item_count", "active", "create_time", "stop_time"); } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingRuleExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingRuleExecutor.java index f9f7c6d0e79d9..d17fe3f510a90 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingRuleExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/distsql/handler/query/ShowStreamingRuleExecutor.java @@ -33,7 +33,7 @@ public final class ShowStreamingRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowStreamingRuleStatement sqlStatement) { return queryResult.getColumnNames(); } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckAlgorithmsExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckAlgorithmsExecutor.java index 3402632edfb9d..5b54afcad3d47 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckAlgorithmsExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckAlgorithmsExecutor.java @@ -32,7 +32,7 @@ public final class ShowMigrationCheckAlgorithmsExecutor implements DistSQLQueryExecutor { @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowMigrationCheckAlgorithmsStatement sqlStatement) { return new PluginMetaDataQueryResultRows(TableDataConsistencyChecker.class).getColumnNames(); } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckStatusExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckStatusExecutor.java index eaf4013129a0e..234d7877220f9 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckStatusExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckStatusExecutor.java @@ -39,7 +39,7 @@ public final class ShowMigrationCheckStatusExecutor implements DistSQLQueryExecu private final ConsistencyCheckJobAPI jobAPI = new ConsistencyCheckJobAPI(new ConsistencyCheckJobType()); @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowMigrationCheckStatusStatement sqlStatement) { return Arrays.asList("tables", "result", "check_failed_tables", "active", "inventory_finished_percentage", "inventory_remaining_seconds", "incremental_idle_seconds", "check_begin_time", "check_end_time", "duration_seconds", "algorithm_type", "algorithm_props", "error_message"); } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationJobStatusExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationJobStatusExecutor.java index 0dfd96d631dbe..662faa0344406 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationJobStatusExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationJobStatusExecutor.java @@ -37,7 +37,7 @@ public final class ShowMigrationJobStatusExecutor implements DistSQLQueryExecutor { @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowMigrationStatusStatement sqlStatement) { return Arrays.asList("item", "data_source", "tables", "status", "active", "processed_records_count", "inventory_finished_percentage", "incremental_idle_seconds", "error_message"); } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationListExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationListExecutor.java index 3c14b2d8ee17e..0a9ca3a171116 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationListExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationListExecutor.java @@ -38,7 +38,7 @@ public final class ShowMigrationListExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowMigrationListStatement sqlStatement) { return Arrays.asList("id", "tables", "job_item_count", "active", "create_time", "stop_time"); } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationSourceStorageUnitsExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationSourceStorageUnitsExecutor.java index ec6ec4bc27aa7..7c4b4ae818851 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationSourceStorageUnitsExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationSourceStorageUnitsExecutor.java @@ -41,7 +41,7 @@ public final class ShowMigrationSourceStorageUnitsExecutor implements DistSQLQue private final MigrationJobAPI jobAPI = (MigrationJobAPI) TypedSPILoader.getService(TransmissionJobAPI.class, "MIGRATION"); @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowMigrationSourceStorageUnitsStatement sqlStatement) { return Arrays.asList("name", "type", "host", "port", "db", "connection_timeout_milliseconds", "idle_timeout_milliseconds", "max_lifetime_milliseconds", "max_pool_size", "min_pool_size", "read_only", "other_attributes"); } diff --git a/kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/query/ShowGlobalClockRuleExecutor.java b/kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/query/ShowGlobalClockRuleExecutor.java index ec41f434b1edd..6ad3d01ae4a5f 100644 --- a/kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/query/ShowGlobalClockRuleExecutor.java +++ b/kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/query/ShowGlobalClockRuleExecutor.java @@ -40,7 +40,7 @@ public final class ShowGlobalClockRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowGlobalClockRuleStatement sqlStatement) { return Arrays.asList("type", "provider", "enable", "props"); } diff --git a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowDefaultSingleTableStorageUnitExecutor.java b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowDefaultSingleTableStorageUnitExecutor.java index a741d117750f0..1fd2096f61ca8 100644 --- a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowDefaultSingleTableStorageUnitExecutor.java +++ b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowDefaultSingleTableStorageUnitExecutor.java @@ -37,7 +37,7 @@ public final class ShowDefaultSingleTableStorageUnitExecutor implements DistSQLQ private SingleRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowDefaultSingleTableStorageUnitStatement sqlStatement) { return Collections.singleton("storage_unit_name"); } diff --git a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowSingleTableExecutor.java b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowSingleTableExecutor.java index 2ac465f9f128c..4c3675def0564 100644 --- a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowSingleTableExecutor.java +++ b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowSingleTableExecutor.java @@ -44,7 +44,7 @@ public final class ShowSingleTableExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowSingleTableStatement sqlStatement) { return Arrays.asList("table_name", "storage_unit_name"); } diff --git a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowUnloadedSingleTableExecutor.java b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowUnloadedSingleTableExecutor.java index 1d9f44763493d..b3916182e2cf2 100644 --- a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowUnloadedSingleTableExecutor.java +++ b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowUnloadedSingleTableExecutor.java @@ -50,7 +50,7 @@ public final class ShowUnloadedSingleTableExecutor implements DistSQLQueryExecut private SingleRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowUnloadedSingleTableStatement sqlStatement) { return Arrays.asList("table_name", "storage_unit_name"); } diff --git a/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java b/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java index a7bf8b129a334..486e060d66ffd 100644 --- a/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java +++ b/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java @@ -39,7 +39,7 @@ public final class ShowSQLFederationRuleExecutor implements DistSQLQueryExecutor private SQLFederationRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowSQLFederationRuleStatement sqlStatement) { return Arrays.asList("sql_federation_enabled", "all_query_use_sql_federation", "execution_plan_cache"); } diff --git a/kernel/sql-parser/distsql/handler/src/main/java/org/apache/shardingsphere/parser/distsql/handler/query/ShowSQLParserRuleExecutor.java b/kernel/sql-parser/distsql/handler/src/main/java/org/apache/shardingsphere/parser/distsql/handler/query/ShowSQLParserRuleExecutor.java index 45dcf78b4734c..c8a43ecf73807 100644 --- a/kernel/sql-parser/distsql/handler/src/main/java/org/apache/shardingsphere/parser/distsql/handler/query/ShowSQLParserRuleExecutor.java +++ b/kernel/sql-parser/distsql/handler/src/main/java/org/apache/shardingsphere/parser/distsql/handler/query/ShowSQLParserRuleExecutor.java @@ -39,7 +39,7 @@ public final class ShowSQLParserRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowSQLParserRuleStatement sqlStatement) { return Arrays.asList("parse_tree_cache", "sql_statement_cache"); } diff --git a/kernel/sql-translator/distsql/handler/src/main/java/org/apache/shardingsphere/sqltranslator/distsql/handler/query/ShowSQLTranslatorRuleExecutor.java b/kernel/sql-translator/distsql/handler/src/main/java/org/apache/shardingsphere/sqltranslator/distsql/handler/query/ShowSQLTranslatorRuleExecutor.java index 4770d96fe4466..2ab55e89d28fd 100644 --- a/kernel/sql-translator/distsql/handler/src/main/java/org/apache/shardingsphere/sqltranslator/distsql/handler/query/ShowSQLTranslatorRuleExecutor.java +++ b/kernel/sql-translator/distsql/handler/src/main/java/org/apache/shardingsphere/sqltranslator/distsql/handler/query/ShowSQLTranslatorRuleExecutor.java @@ -40,7 +40,7 @@ public final class ShowSQLTranslatorRuleExecutor implements DistSQLQueryExecutor private SQLTranslatorRule rule; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowSQLTranslatorRuleStatement sqlStatement) { return Arrays.asList("type", "props", "use_original_sql_when_translating_failed"); } diff --git a/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java b/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java index ac74595be09e7..c0a5f97e25f6d 100644 --- a/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java +++ b/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java @@ -42,7 +42,7 @@ public final class ShowTrafficRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowTrafficRulesStatement sqlStatement) { return Arrays.asList("name", "labels", "algorithm_type", "algorithm_props", "load_balancer_type", "load_balancer_props"); } diff --git a/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java b/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java index 1897a59994c67..aeca748ca8e11 100644 --- a/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java +++ b/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java @@ -39,7 +39,7 @@ public final class ShowTransactionRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowTransactionRuleStatement sqlStatement) { return Arrays.asList("default_type", "provider_type", "props"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationExecutor.java index ccf99827efaed..9b68b1370bd51 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationExecutor.java @@ -59,7 +59,7 @@ public final class ConvertYamlConfigurationExecutor implements DistSQLQueryExecu private final YamlProxyDataSourceConfigurationSwapper dataSourceConfigSwapper = new YamlProxyDataSourceConfigurationSwapper(); @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ConvertYamlConfigurationStatement statement) { return Collections.singleton("dist_sql"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationExecutor.java index bbb54104ff8db..b4c4de6434e2e 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationExecutor.java @@ -38,7 +38,7 @@ public final class ExportDatabaseConfigurationExecutor implements DistSQLQueryEx private ShardingSphereDatabase database; @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ExportDatabaseConfigurationStatement sqlStatement) { return Collections.singleton("result"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportMetaDataExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportMetaDataExecutor.java index 1b6da4269baf4..259856b28192c 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportMetaDataExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportMetaDataExecutor.java @@ -53,7 +53,7 @@ public final class ExportMetaDataExecutor implements DistSQLQueryExecutor { @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ExportMetaDataStatement sqlStatement) { return Arrays.asList("id", "create_time", "cluster_info"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportStorageNodesExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportStorageNodesExecutor.java index 4c33b0b4d5d64..673bb369ced08 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportStorageNodesExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportStorageNodesExecutor.java @@ -46,7 +46,7 @@ public final class ExportStorageNodesExecutor implements DistSQLQueryExecutor { @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ExportStorageNodesStatement sqlStatement) { return Arrays.asList("id", "create_time", "storage_nodes"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeInfoExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeInfoExecutor.java index 256da6555557a..ebc3a2a6cda7e 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeInfoExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeInfoExecutor.java @@ -35,7 +35,7 @@ public final class ShowComputeNodeInfoExecutor implements DistSQLQueryExecutor { @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowComputeNodeInfoStatement sqlStatement) { return Arrays.asList("instance_id", "host", "port", "status", "mode_type", "worker_id", "labels", "version"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeModeExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeModeExecutor.java index 662e57dddd5c4..9acd043288d11 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeModeExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeModeExecutor.java @@ -34,7 +34,7 @@ public final class ShowComputeNodeModeExecutor implements DistSQLQueryExecutor { @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowComputeNodeModeStatement sqlStatement) { return Arrays.asList("type", "repository", "props"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodesExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodesExecutor.java index 0902c55c79537..4e176a6eb82e5 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodesExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodesExecutor.java @@ -36,7 +36,7 @@ public final class ShowComputeNodesExecutor implements DistSQLQueryExecutor { @Override - public Collection getColumnNames() { + public Collection getColumnNames(final ShowComputeNodesStatement sqlStatement) { return Arrays.asList("instance_id", "instance_type", "host", "port", "status", "mode_type", "worker_id", "labels", "version"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariableExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariableExecutor.java index c18d89a378893..87214fadf05dc 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariableExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariableExecutor.java @@ -50,7 +50,7 @@ public final class ShowDistVariableExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowDistVariableStatement sqlStatement) { return Arrays.asList("variable_name", "variable_value"); } 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 c3d232e4bd2c9..5376d792b8cf9 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,7 @@ public final class ShowDistVariablesExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowDistVariablesStatement sqlStatement) { return Arrays.asList("variable_name", "variable_value"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationRuleExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationRuleExecutor.java index ff45c7815b34f..39504cb4e9f00 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationRuleExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationRuleExecutor.java @@ -33,7 +33,7 @@ public final class ShowMigrationRuleExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowMigrationRuleStatement sqlStatement) { return queryResult.getColumnNames(); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetaDataExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetaDataExecutor.java index a8a7ac258ae49..d9ea9342efdca 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetaDataExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetaDataExecutor.java @@ -45,7 +45,7 @@ public final class ShowTableMetaDataExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ShowTableMetaDataStatement sqlStatement) { return Arrays.asList("database_name", "table_name", "type", "name", "value"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/FormatSQLExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/FormatSQLExecutor.java index 54c8982183453..ca21dbf9030a2 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/FormatSQLExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/FormatSQLExecutor.java @@ -41,7 +41,7 @@ public final class FormatSQLExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final FormatStatement sqlStatement) { return Collections.singleton("formatted_result"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/ParseDistSQLExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/ParseDistSQLExecutor.java index 0c676fc1dd91f..5d39b6e32d9eb 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/ParseDistSQLExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/ParseDistSQLExecutor.java @@ -42,7 +42,7 @@ public final class ParseDistSQLExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final ParseStatement sqlStatement) { return Arrays.asList("parsed_statement", "parsed_statement_detail"); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/PreviewExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/PreviewExecutor.java index 9668c84013cd6..8f450a881eaac 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/PreviewExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/PreviewExecutor.java @@ -81,7 +81,7 @@ public final class PreviewExecutor implements DistSQLQueryExecutor getColumnNames() { + public Collection getColumnNames(final PreviewStatement sqlStatement) { return Arrays.asList("data_source_name", "actual_sql"); }