caorong opened a new issue, #32967:
URL: https://github.com/apache/shardingsphere/issues/32967

   ## Bug Report
   
   
   my sharding rule
   
   ```
   CREATE SHARDING TABLE RULE Tokens (
   DATANODES("db_${0..3}.Tokens_${0..31}"),
   
DATABASE_STRATEGY(TYPE="standard",SHARDING_COLUMN=user_id,SHARDING_ALGORITHM(TYPE(NAME="inline",PROPERTIES("algorithm-expression"="db_${user_id
 % 4}")))),
   
TABLE_STRATEGY(TYPE="standard",SHARDING_COLUMN=user_id,SHARDING_ALGORITHM(TYPE(NAME="inline",PROPERTIES("algorithm-expression"="Tokens_${user_id
 % 32}")))),
   KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME="snowflake")),
   AUDIT_STRATEGY (TYPE(NAME="DML_SHARDING_CONDITIONS"),ALLOW_HINT_DISABLE=true)
   );
   ```
   
   my broadcast query sql:
   
   ```
   select * from TokenBalances tb where token in ('abc') and user_id not in 
(14327,59397,51107,69359)  and holding<>0
   ```
   
   
   preview result:
   ```
   preview select *  from TokenBalances tb where token in ('xx') and user_id 
not in (14327,59397,51107,69359)  and holding<>0;
   
   
   | nexus_1          | select *  from TokenBalances_15 tb where token in 
('xx') and user_id not in (14327,59397,51107,69359)  and holding<>0 UNION ALL 
select *  from TokenBalances_23 tb where token in ('xx') and user_id not in 
(14327,59397,51107,69359)  and holding<>0 UNION ALL select *  from 
TokenBalances_3 tb where token in ('xx') and user_id not in 
(14327,59397,51107,69359)  and holding<>0 UNION ALL select *  from 
TokenBalances_5 tb where token in ('xx') and user_id not in 
(14327,59397,51107,69359)  and holding<>0 |
   | nexus_3          | select *  from TokenBalances_15 tb where token in 
('xx') and user_id not in (14327,59397,51107,69359)  and holding<>0 UNION ALL 
select *  from TokenBalances_23 tb where token in ('xx') and user_id not in 
(14327,59397,51107,69359)  and holding<>0 UNION ALL select *  from 
TokenBalances_3 tb where token in ('xx') and user_id not in 
(14327,59397,51107,69359)  and holding<>0 UNION ALL select *  from 
TokenBalances_5 tb where token in ('xx') and user_id not in 
(14327,59397,51107,69359)  and holding<>0 |
   ```
   
   
   
   
   ### Which version of ShardingSphere did you use?
   5.5.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy + ShardingSphere-JDBC
   
   ### Expected behavior
   
   preview result should query all 32 x 4 table
   
   ### Actual behavior
   
   only query table which routed by `14327,59397,51107,69359` which I want to 
exclude.
   
   ### Reason analyze (If you can)
   
   sql parser layer treate `select xx where user not in` same with `select xx 
where user in`
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   ### 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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to