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 2020/10/28 07:08:56 UTC

[GitHub] [shardingsphere] Lucas-307 commented on issue #7940: 【sharding-proxy】Actual SQL execution results are incorrect (data should have been returned, but no data was returned),

Lucas-307 commented on issue #7940:
URL: https://github.com/apache/shardingsphere/issues/7940#issuecomment-717745707


   @duzhanfei Hi ,you can execute under sql in `ds_0.pscst_prdt_cvr0` directly. I guess you can't find anything.
   
   ```sql
   SELECT BIZ_DT, ECIF_CUST_NO, DEP_FLG, DBTCD_FLG, PLM_PY_FLG,
   PY_GTWY_FLG, SFSRV_EQP_SGNG_FLG, ATMBL_MRTG_FLG, HS_MRTG_FLG, HLPFM_ETMN_FLG,
   PSNL_MANG_LN_FLG, PSNL_CNSM_LN_FLG, ETC_FLG, CSCRD_FLG, MBLBNK_FLG,
   EBP_SGNG_FLG FROM pscst_prdt_cvr0 WHERE ECIF_CUST_NO = 10000
   ```
   
   Please make sure your data is match your `shardingRule`. 
   
   If there are same datas `ECIF_CUST_NO = 10000` but not in `ds_0.pscst_prdt_cvr0`, we can't find it. (we called it dirty data.) Because if a sql include shardingKey, we will calcuate and execute in matched table directly and ignore other sharding tables.
   
   By the way, your `shardingRule` is unreasonable. Only `ds0.pscst_prdt_cvr0` and `ds1.pscst_prdt_cvr1` include datas by the same database and table strategy.
   
   ```yaml
   databaseStrategy:
   inline:
   shardingColumn: ecif_cust_no
   algorithmExpression: ds_${ecif_cust_no % 2}
   tableStrategy:
   inline:
   shardingColumn: ecif_cust_no
   algorithmExpression: pscst_prdt_cvr${ecif_cust_no % 2}
   ```
   


----------------------------------------------------------------
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:
users@infra.apache.org