RaigorJiang commented on code in PR #23797:
URL: https://github.com/apache/shardingsphere/pull/23797#discussion_r1089886692
##########
features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java:
##########
@@ -17,53 +17,54 @@
package org.apache.shardingsphere.encrypt.distsql.handler.query;
-import
org.apache.shardingsphere.distsql.handler.resultset.DatabaseDistSQLResultSet;
+import org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
import
org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
import
org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
import
org.apache.shardingsphere.encrypt.distsql.parser.statement.ShowEncryptRulesStatement;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
+import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
-import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
/**
- * Result set for show encrypt rule.
+ * Show encrypt rule executor.
*/
-public final class EncryptRuleResultSet implements DatabaseDistSQLResultSet {
-
- private Iterator<Collection<Object>> data = Collections.emptyIterator();
+public final class ShowEncryptRuleExecutor implements
RQLExecutor<ShowEncryptRulesStatement> {
@Override
- public void init(final ShardingSphereDatabase database, final SQLStatement
sqlStatement) {
+ public Collection<LocalDataQueryResultRow> getRows(final
ShardingSphereDatabase database, final ShowEncryptRulesStatement sqlStatement) {
Optional<EncryptRule> rule =
database.getRuleMetaData().findSingleRule(EncryptRule.class);
- rule.ifPresent(optional -> data = buildData((EncryptRuleConfiguration)
optional.getConfiguration(), (ShowEncryptRulesStatement)
sqlStatement).iterator());
+ Collection<LocalDataQueryResultRow> result = new LinkedList<>();
+
Review Comment:
Unnecessary blank line.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]