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 2021/09/16 12:57:55 UTC

[GitHub] [shardingsphere] valleyG opened a new issue #12501: NullPointerException ,when use broadcast_table ,execute sql contain "count()".

valleyG opened a new issue #12501:
URL: https://github.com/apache/shardingsphere/issues/12501


   ## Bug Report
   
   `Cause: java.lang.NullPointerException
   	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.1.jar:3.5.1]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149) ~[mybatis-3.5.1.jar:3.5.1]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.1.jar:3.5.1]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76) ~[mybatis-3.5.1.jar:3.5.1]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ~[mybatis-spring-2.0.1.jar:2.0.1]
   	... 108 common frames omitted
   Caused by: java.lang.NullPointerException: null
   	at org.apache.shardingsphere.sharding.merge.dql.groupby.GroupByMemoryMergedResult.getValueCaseSensitiveFromTables(GroupByMemoryMergedResult.java:132) ~[shardingsphere-sharding-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sharding.merge.dql.groupby.GroupByMemoryMergedResult.getValueCaseSensitive(GroupByMemoryMergedResult.java:122) ~[shardingsphere-sharding-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sharding.merge.dql.groupby.GroupByMemoryMergedResult.init(GroupByMemoryMergedResult.java:72) ~[shardingsphere-sharding-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sharding.merge.dql.groupby.GroupByMemoryMergedResult.init(GroupByMemoryMergedResult.java:52) ~[shardingsphere-sharding-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.infra.merge.result.impl.memory.MemoryMergedResult.<init>(MemoryMergedResult.java:51) ~[shardingsphere-infra-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sharding.merge.dql.groupby.GroupByMemoryMergedResult.<init>(GroupByMemoryMergedResult.java:55) ~[shardingsphere-sharding-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger.getGroupByMergedResult(ShardingDQLResultMerger.java:108) ~[shardingsphere-sharding-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger.build(ShardingDQLResultMerger.java:78) ~[shardingsphere-sharding-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger.merge(ShardingDQLResultMerger.java:63) ~[shardingsphere-sharding-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.infra.merge.MergeEngine.executeMerge(MergeEngine.java:87) ~[shardingsphere-infra-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.infra.merge.MergeEngine.merge(MergeEngine.java:77) ~[shardingsphere-infra-merge-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.mergeQuery(ShardingSpherePreparedStatement.java:283) ~[shardingsphere-jdbc-core-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.getResultSet(ShardingSpherePreparedStatement.java:232) ~[shardingsphere-jdbc-core-5.0.0-alpha.jar:5.0.0-alpha]`
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.0.0-alpha
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC 
   ### Expected behavior
   
   ### Actual behavior
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   select count(1) as number from user_info a left join broadcast_table b on a.name =b.name where a.id = ?
   ### Example codes for reproduce this issue (such as a github link).
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin commented on issue #12501: NullPointerException ,when use broadcast_table ,execute sql contain "count()".

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #12501:
URL: https://github.com/apache/shardingsphere/issues/12501#issuecomment-922249150


   @valleyG 
   Thanks for the feedback, we also found the same problem on the master branch, and the pr submitted later will fix this problem on the master branch.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #12501: NullPointerException ,when use broadcast_table ,execute sql contain "count()".

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #12501:
URL: https://github.com/apache/shardingsphere/issues/12501#issuecomment-921380662


   Hi @valleyG, can you provide your configuration? I need more information to reproduce this exception.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] valleyG commented on issue #12501: NullPointerException ,when use broadcast_table ,execute sql contain "count()".

Posted by GitBox <gi...@apache.org>.
valleyG commented on issue #12501:
URL: https://github.com/apache/shardingsphere/issues/12501#issuecomment-922254840


   @tuichenchuxin ok,thinks!


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] valleyG commented on issue #12501: NullPointerException ,when use broadcast_table ,execute sql contain "count()".

Posted by GitBox <gi...@apache.org>.
valleyG commented on issue #12501:
URL: https://github.com/apache/shardingsphere/issues/12501#issuecomment-921383273


   @strongduanmu
    thanks!
   
   ```yaml
   spring:
     shardingsphere:
       datasource:
         names: ds1,ds2
         common:
           type: com.zaxxer.hikari.HikariDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
           auto-commit: true
           connection-test-query: SELECT 1
           connection-timeout: 30000
           idle-timeout: 600000
           max-lifetime: 1800000
           maximum-pool-size: 32
           minimum-idle: 10
         ds1:
           jdbc-url: jdbc:mysql://192.168.73.106:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&&allowMultiQueries=true&socketTimeout=60000&connectTimeout=30000
           username: root
           password: 123456
         ds2:
           jdbc-url: jdbc:mysql://192.168.73.106:3306/test_1?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&&allowMultiQueries=true&socketTimeout=60000&connectTimeout=30000
           username: root
           password: 123456
       rules:
         sharding:
           broadcastTables:
             broadcast_table
           tables:
             #逻辑表名
             user_info:
               #实际数据节点
               actual-data-nodes: ds$->{1..2}.user_info
               #分库策略
               database-strategy:
                 standard:
                   sharding-column: name
                   sharding-algorithm-name: name-hash-mod
   
           #分片策略配置
          sharding-algorithms:
             name-hash-mod:
               type: HASH_MOD
               props:
                 modAcc: 2
                 initUtil: true
   
           key-generators:
             snowflake:
               type: SNOWFLAKE
               props:
                 worker-id: 123
       props:
         sql-show: true
         sql-simple: false
   ```
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #12501: NullPointerException ,when use broadcast_table ,execute sql contain "count()".

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #12501:
URL: https://github.com/apache/shardingsphere/issues/12501#issuecomment-921338453


   @valleyG Thank you for your feedback, i will investigate this issue.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] valleyG edited a comment on issue #12501: NullPointerException ,when use broadcast_table ,execute sql contain "count()".

Posted by GitBox <gi...@apache.org>.
valleyG edited a comment on issue #12501:
URL: https://github.com/apache/shardingsphere/issues/12501#issuecomment-922254840


   @tuichenchuxin ok,thanks!


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu closed issue #12501: NullPointerException ,when use broadcast_table ,execute sql contain "count()".

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #12501:
URL: https://github.com/apache/shardingsphere/issues/12501


   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org