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 2022/10/21 08:54:11 UTC
[GitHub] [shardingsphere] wangyu3619 opened a new issue, #21683: query error
wangyu3619 opened a new issue, #21683:
URL: https://github.com/apache/shardingsphere/issues/21683
when i query data ,throw this exception.
i debug the code ,find that the ShardingSphereSchema do have the informations about my ShardingSphereTables.
i use ShardingSphere-jdbc 5.2.0 in Standalone mode in my springboot project.
can you help me?
java.lang.NullPointerException: null
at org.apache.shardingsphere.sharding.merge.dql.orderby.OrderByValue.getOrderValuesCaseSensitiveFromTables(OrderByValue.java:74)
at org.apache.shardingsphere.sharding.merge.dql.orderby.OrderByValue.getOrderValuesCaseSensitive(OrderByValue.java:64)
at org.apache.shardingsphere.sharding.merge.dql.orderby.OrderByValue.<init>(OrderByValue.java:58)
at org.apache.shardingsphere.sharding.merge.dql.orderby.OrderByStreamMergedResult.orderResultSetsToQueue(OrderByStreamMergedResult.java:56)
at org.apache.shardingsphere.sharding.merge.dql.orderby.OrderByStreamMergedResult.<init>
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #21683: query error
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #21683:
URL: https://github.com/apache/shardingsphere/issues/21683#issuecomment-1287552972
Please check whether your actualTable exists first, ShardingSphere will load metadata according to actualTable.
--
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] wangyu3619 commented on issue #21683: query error
Posted by GitBox <gi...@apache.org>.
wangyu3619 commented on issue #21683:
URL: https://github.com/apache/shardingsphere/issues/21683#issuecomment-1287572472
actual-data-nodes all exists?but how to config when i use shardingsphere in time rolling tables circumstance. I can't find instructions for dynamically refreshing metadatas in 5.2.0
--
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] wangyu3619 commented on issue #21683: query error
Posted by GitBox <gi...@apache.org>.
wangyu3619 commented on issue #21683:
URL: https://github.com/apache/shardingsphere/issues/21683#issuecomment-1287564100
The tables exist.when i config two rules,i can only get the metadata of logictable center_stat_info .but when i change the name of logic table node_stat_info to another one ,i can get the tables infomations of node_stat_info by sharingspheredatasource
--
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] wangyu3619 commented on issue #21683: query error
Posted by GitBox <gi...@apache.org>.
wangyu3619 commented on issue #21683:
URL: https://github.com/apache/shardingsphere/issues/21683#issuecomment-1288623813
@strongduanmu how to config when i use shardingsphere in time rolling tables circumstance. I can't find instructions for dynamically refreshing metadatas in 5.2.0
--
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 #21683: query error
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #21683:
URL: https://github.com/apache/shardingsphere/issues/21683#issuecomment-1287567015
From your screenshot, the actual table starting with 2023 does not exist. You need to ensure that the table configured in actual-data-nodes all exists.
--
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] ZZemptypoint commented on issue #21683: query error
Posted by "ZZemptypoint (via GitHub)" <gi...@apache.org>.
ZZemptypoint commented on issue #21683:
URL: https://github.com/apache/shardingsphere/issues/21683#issuecomment-1414701135
@wangyu3619 In fact, actual tables can be defined ahead of time, for example
```groovy
actual-data-nodes: db1.center_stat_info_$->{2022..2050}q$->{1..4}
```
will generate table names `enter_stat_info_2022q1`, `enter_stat_info_2022q2`...`enter_stat_info_2050q4` and so on in ShardingSphere `availableTargetNames`,
but physical table such as `enter_stat_info_2050q4` does not need to be exist in database.
you can create physical table everyday in any way.
--
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] wangyu3619 commented on issue #21683: query error
Posted by GitBox <gi...@apache.org>.
wangyu3619 commented on issue #21683:
URL: https://github.com/apache/shardingsphere/issues/21683#issuecomment-1286737462
i debug the code ,find that the ShardingSphereDataSource data source does not contain all my sharding tables infomation.
![image](https://user-images.githubusercontent.com/19728206/197167907-31a17373-8caa-4ec8-b322-4c68e321e32d.png)
**this is my configs:**
`spring.shardingsphere.datasource.master.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.master.driver-class-name=org.mariadb.jdbc.Driver
spring.shardingsphere.datasource.master.jdbc-url=jdbc:mysql://127.0.0.1:3306/test-new-oms?useSSL=false&useServerPrepStmts=false&rewriteBatchedStatements=true&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8
spring.shardingsphere.datasource.master.username=root
spring.shardingsphere.datasource.master.password=root
spring.shardingsphere.datasource.master.binding-tables=node_stat_info,stat_center_info
spring.shardingsphere.rules.sharding.tables.node_stat_info.actual-data-nodes=master.node_stat_info_$->{2022..2030}$->{['01','02','03','04','05','06','07','08','09','10','11','12']}$->{['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31']}
spring.shardingsphere.rules.sharding.tables.center_stat_info.actual-data-nodes=master.stat_center_info_$->{2022..2030}$->{['01','02','03','04','05','06','07','08','09','10','11','12']}$->{['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31']}
spring.shardingsphere.rules.sharding.tables.node_stat_info.table-strategy.standard.sharding-column=sampling_time
spring.shardingsphere.rules.sharding.tables.node_stat_info.table-strategy.standard.sharding-algorithm-name=sharding-by-day
spring.shardingsphere.rules.sharding.tables.center_stat_info.table-strategy.standard.sharding-column=sampling_time
spring.shardingsphere.rules.sharding.tables.center_stat_info.table-strategy.standard.sharding-algorithm-name=sharding-by-day
spring.shardingsphere.rules.sharding.sharding-algorithms.sharding-by-day.type=CLASS_BASED
spring.shardingsphere.rules.sharding.sharding-algorithms.sharding-by-day.props.strategy=standard
spring.shardingsphere.rules.sharding.sharding-algorithms.sharding-by-day.props.algorithmClassName=com.config.ShardingByDayTime`
i configed two rules ,but i can find only one shardingTable`s infomations in the ShardingSphereSchema.
I crete a table every day.
![image](https://user-images.githubusercontent.com/19728206/197170238-df4fe0c1-9b74-48aa-a037-b708733a2a90.png)
--
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] wangyu3619 commented on issue #21683: query error
Posted by GitBox <gi...@apache.org>.
wangyu3619 commented on issue #21683:
URL: https://github.com/apache/shardingsphere/issues/21683#issuecomment-1286738671
i need help.
--
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