lengyul commented on issue #4580: shardingsphere: Regarding routing to multiple data nodes, when querying with aggregate functions (count, max, avg ...), how to deal with the total statistics of multiple tables? URL: https://github.com/apache/incubator-shardingsphere/issues/4580#issuecomment-595028784 > Group query/aggregation is supported by ShardingSphere. > > In version 4.x, you can config precise algorithm for between statements. > > > We need to discuss this pull request: > > > > 1. For standard sharding strategy, user need config precise algorithm (for =, IN) and range algorithm (for BETWEEN AND, <, >, >=, <=). If range algorithm absent, the SQL contains BETWEEN should query all data nodes. That is correct, because user know they do not config range algorithm explicitly; > > 2. For inline sharding strategy, user only can config precise algorithm via inline expression, and cannot config range algorithm. So throw exception when SQL contains BETWEEN may better than query all data nodes. If query all data nodes instead of explicit exception, user may missing the potential performance issue. > > In version 5.x of master branch(not release yet), you can directly config the follow parameter in server.yaml to allow between statement query in inline sharding. > > > allow.range.query.with.inline.sharding: true Ok thank you, the problem has been solved. I use version 4.0.0 Implements the doSharding method provided by RangeShardingAlgorithm.class. However, some minor problems were found during use (not affecting my use), the following 1. ROUND(AVG(column),2) With function nesting,When routing multiple data nodes for queries, the results (multiple results) of the respective tables are returned instead of a total stat. -- 2.The SQL [order by $ {param}] param written by mybatis's mapper.xml is not recognized, the specific error message is: bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter x Thanks again
---------------------------------------------------------------- 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
