zihaoAK47 commented on code in PR #28759:
URL: https://github.com/apache/shardingsphere/pull/28759#discussion_r1361442074
##########
kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngine.java:
##########
@@ -113,26 +113,14 @@ public SQLFederationEngine(final String databaseName,
final String schemaName, f
* @param globalRuleMetaData global rule meta data
* @return use SQL federation or not
*/
- @SuppressWarnings({"unchecked", "rawtypes"})
public boolean decide(final SQLStatementContext sqlStatementContext, final
List<Object> parameters,
final ShardingSphereDatabase database, final
RuleMetaData globalRuleMetaData) {
// TODO BEGIN: move this logic to SQLFederationDecider implement class
when we remove sql federation type
if (isQuerySystemSchema(sqlStatementContext, database)) {
return true;
}
// TODO END
- boolean sqlFederationEnabled =
sqlFederationRule.getConfiguration().isSqlFederationEnabled();
Review Comment:
Hi mentor, while ensuring the correct execution of the decide method, this
is a small change I have attempted.
The code below is the decision logic for making query statements. Place this
part of the logic in a method named selectDecide and change the judgment logic
of code `!sqlFederationEnabled || !(sqlStatementContext instanceof
SelectStatementContext)` to code `isEnableSqlFederation() &&
selectDecide(sqlStatementContext, parameters, database, globalRuleMetaData).`
I think it will be easier to understand the decision logic of the decide
method.
--
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]