terrymanu edited a comment on issue #2275: Reconstruct rewriting module
URL: 
https://github.com/apache/incubator-shardingsphere/issues/2275#issuecomment-494653578
 
 
   Some suggestions:
   
   1. Remove SQLRewriteEngine.originalSQL, use sqlStatement.getLogicSQL()
   2. For EncryptRule with SQLRewriteEngine, use current DatabaseType instead 
of DatabaseType.MySQL
   3. SQLRewriteEngine.isRewriteDistinctLiteral => isMeedRewriteDistinctLiteral
   4. SQLRewriteEngine.isContainsAggregationDistinctToken can move to 
sqlStatement, and let token type as an input parameter
   5. SelectStatement.getFirstSelectItemStartIndex() should as a Token and 
Split append distinct from rewriteInitialLiteral
   6. Make sure responsibility of rewriter and engine, only rewriter can use 
token
   7. EncryptSQLRewriter & ShardingSQLRewriter can new instance out of loop
   8. Make unify with stopPosition & stopIndex
   9. sqlBuilder is global field with SQLRewriteEngine, may avoid pass from 
private method by input parameter
   10. Make accurate with javadoc on SQLRewriter.rewrite
   11. Avoid start a new line if not exceed 200 char one line, at line 107 on 
EncryptSQLRewriter
   12. Make input parameter as same sequence for differnet methods, like: 
EncryptSQLRewriter.encryptInsertOptimizeResultUnit and 
EncryptSQLRewriter.encryptInsertOptimizeResult's param: unit
   13. add Predicate if Optional can not be absent, at line 105 on 
EncryptSQLRewriter
   14. InsertParameterUnit => InsertParameterGroup?
   15. Decouple SQLBuilder & ParameterBuilder
   16. Remove SchemaPlaceholder and test cases
   17. Add new method `appendPlaceholder` for SQLToken and polymorphic 
appendXXXPlaceholder

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


With regards,
Apache Git Services

Reply via email to