terrymanu commented on a change in pull request #7476:
URL: https://github.com/apache/shardingsphere/pull/7476#discussion_r489417167



##########
File path: 
shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/projection/impl/DerivedProjection.java
##########
@@ -38,6 +39,8 @@
     
     private final String alias;
     
+    private final SQLSegment projection;

Review comment:
       original projection maybe a better name

##########
File path: 
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-rewrite/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ProjectionsToken.java
##########
@@ -18,26 +18,29 @@
 package org.apache.shardingsphere.sharding.rewrite.token.pojo;
 
 import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.Attachable;
+import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.RouteUnitAware;
 import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.SQLToken;
+import org.apache.shardingsphere.infra.route.context.RouteUnit;
 
 import java.util.Collection;
+import java.util.Map;
 
 /**
  * Projections token.
  */
-public final class ProjectionsToken extends SQLToken implements Attachable {
+public final class ProjectionsToken extends SQLToken implements Attachable, 
RouteUnitAware {
     
-    private final Collection<String> projections;
+    private final Map<RouteUnit, Collection<String>> projections;
     
-    public ProjectionsToken(final int startIndex, final Collection<String> 
projections) {
+    public ProjectionsToken(final int startIndex, final Map<RouteUnit, 
Collection<String>> projections) {

Review comment:
       t too hard to understand, what is the Collection<String>?
   It is better to make the code for read easier.

##########
File path: 
shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/TableExtractUtils.java
##########
@@ -198,7 +198,12 @@ public void extractTablesFromUpdate(final UpdateStatement 
updateStatement) {
         }
     }
     
-    private boolean needRewrite(final OwnerSegment owner) {
+    /**

Review comment:
       It is invalid if util class has state, please consider change class name




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to