Comments (4)
or的处理是基于不包含or处理器之上的。mergeCurrentConditionContext这个方法不是为了处理merge聚合列,是为了生产和or统一的返回格式
from shardingsphere.
@terrymanu ,我测了一下,有or条件的情况,没有做groupby、avg等分组聚合处理;or的处理是基于不包含or处理器之上的?这个哪里体现的,没有看到啊
from shardingsphere.
@pingww 抱歉一开始没有好好理解你的问题。其实sharding-jdbc对or的结果集归并与其他归并方法相同。
com.dangdang.ddframe.rdb.sharding.jdbc.ShardingPreparedStatement
@Override
public ResultSet executeQuery() throws SQLException {
hasExecuted = true;
setCurrentResultSet(ResultSetFactory.getResultSet(new PreparedStatementExecutor(getContext().getExecutorEngine(), getRoutedPreparedStatements()).executeQuery(), getMergeContext()));
return getCurrentResultSet();
}
...
private List<PreparedStatement> routeSQL(final List<Object> parameters) throws SQLException {
List<PreparedStatement> result = new ArrayList<>();
SQLRouteResult sqlRouteResult = getContext().getSqlRouteEngine().route(sql, parameters);
MergeContext mergeContext = sqlRouteResult.getMergeContext();
mergeContext.setExecutorEngine(getContext().getExecutorEngine());
setMergeContext(mergeContext);
for (SQLExecutionUnit each : sqlRouteResult.getExecutionUnits()) {
PreparedStatement preparedStatement = generatePrepareStatement(getShardingConnection().getConnection(each.getDataSource()), each.getSql());
replayMethodsInvovation(preparedStatement);
setParameters(preparedStatement, parameters);
result.add(preparedStatement);
}
return result;
}
也就是不管当前sql是什么,流程都是 SqlRouterEngine-》SQLExecutionUnit -》 ResultSetFactory 。
如果你的示例不能执行归并,那么请把日志级别调整为trace然后发出来,我再进行跟踪。
谢谢
from shardingsphere.
MergeContext 都是在MySQLSelectVisitor里面生成的,OR解析没有使用这个visitor,所以归并上下文为空。 @hanahmily
from shardingsphere.
Related Issues (20)
- org.yaml.snakeyaml.representer.Representer: method 'void <init>()' not found HOT 16
- spring-boot-starter-parent 3.2.4 use shardingsphere-jdbc-core 5.4.1 throw NoSuchMethodError HOT 1
- database-strategy:none not working HOT 6
- NPE when convert yaml configuration with empty data sources or empty rules
- Load single table should check storage units are not empty
- E2E test,build docker image permission denied. HOT 1
- How to start Native test for jdbc-encrypt HOT 1
- Under one mysql instance, two database schemas, how to join tables cross schemas HOT 2
- Add dependency-check-maven to shardingsphere HOT 2
- how to onlu sharding database? HOT 1
- Version 5.4.1 of ShardingSphere references SnakeYAML version 1.33, which has a security vulnerability. How to upgrade it? HOT 1
- TableNotExistsException: Table or view *** does not exist HOT 1
- some question about Readwrite-splitting HOT 1
- null point error when the table name is unstandardized
- 5.4.1 CHAR_DIGEST_LIKE error HOT 8
- Image not loading HOT 1
- gbase 8s Compatibility issues HOT 1
- Database password parsed failed HOT 4
- Use test container instead of docker compose in Agent e2e test
- Native test only support H2?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shardingsphere.