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 2019/05/24 00:53:06 UTC

[GitHub] [incubator-shardingsphere] KomachiSion edited a comment on issue #2431: when select no rows, sharding return Cannot invoke method intdiv() on null object

KomachiSion edited a comment on issue #2431: when select no rows,  sharding return   Cannot invoke method intdiv() on null object
URL: https://github.com/apache/incubator-shardingsphere/issues/2431#issuecomment-495434158
 
 
   > i found that , the sql column must exact match the sharding column , Ac_Id and ac_id like this is not allowed?
   > when the sql do not contain the sharding column , sharding will throw exception or use the
   > defaultDatabase ?
   > i am a beginner of sharding, if something is wrong, sorry about that.
   
   yes, the sharding column name should the same as sql column.  case sensitive.
   In your example, the configuration should be 
   ```
   mdm_acct_conn:
         actualDataNodes: ds${0..1}.mdm_acct_conn
         databaseStrategy:
           inline:
             shardingColumn: Ac_Id
             algorithmExpression: ds${Ac_Id.intdiv(10000) % 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


With regards,
Apache Git Services