You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/06/20 04:27:49 UTC

[GitHub] [incubator-shardingsphere] wangjing112 commented on issue #2587: Update not data sharding on 4.0.0.RC2

wangjing112 commented on issue #2587: Update not data sharding on 4.0.0.RC2
URL: https://github.com/apache/incubator-shardingsphere/issues/2587#issuecomment-503837109
 
 
   i found the problem at OptimizeEngineFactory.newInstance not case UpdateStatement
   why update not need Sharding Optimize Engine?
   ```
   
   @NoArgsConstructor(access = AccessLevel.PRIVATE)
   public final class OptimizeEngineFactory {
       
       /**
        * Create sharding optimize engine instance.
        * 
        * @param shardingRule sharding rule
        * @param sqlStatement SQL statement
        * @param parameters parameters
        * @param shardingTableMetaData sharding table metadata
        * @return optimize engine instance
        */
       public static OptimizeEngine newInstance(final ShardingRule shardingRule, final SQLStatement sqlStatement, final List<Object> parameters, final ShardingTableMetaData shardingTableMetaData) {
           if (sqlStatement instanceof InsertStatement) {
               return new ShardingInsertOptimizeEngine(shardingRule, (InsertStatement) sqlStatement, parameters);
           }
           if (sqlStatement instanceof SelectStatement) {
               return new ShardingSelectOptimizeEngine((SelectStatement) sqlStatement, parameters);
           }
           if (sqlStatement instanceof DDLStatement) {
               return new DDLOptimizeEngine((DDLStatement) sqlStatement, shardingTableMetaData);
           }
           // TODO do with DAL
           return new DefaultOptimizeEngine();
       }
   
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services