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/05/09 13:34:04 UTC

[GitHub] [shardingsphere] tristaZero commented on issue #8982: show tables like xxx% can not return correct result

tristaZero commented on issue #8982:
URL: https://github.com/apache/shardingsphere/issues/8982#issuecomment-835809084


   Hi @MingxingLAI ,
   Thanks for your attention here, sorry for my late coming.
   Let consider this issue with the following scenario,
   
   Suppose here are some tables,
   ```
   t_order (a sharding logic table, including t_order_0, t_order_1)
   t_order_item (a sharding logic table, including t_order_item_0, t_order_item_1)
   t_order_number(a single table)
   t_order_metadata(a broadcast table, each instance has this table)
   t_item_order(a single table)
   ```
   Now, how to filter and return all the `logic tables` to users by `show tables like '%t_order%"?
   
   Firstly,  we need to put maybe two (?) `flags`(`%`) in 'showStatement` to mark it for usage later on.
   Secondly, `show tables like '%t_order%" will be sent to all the DB instances to get all the `actual` tables.
   Thirdly, we need to deal with these results in  `LogicTablesMergedResult`, including,
   - Merge some of the actual tables into `sharding tables` by sharding rules
   - Filter all the target `logic tables` (sharding tables, single tables, broadcast tables) with the two of  `%` marks in  `showStatement` and sharding rules
   Last but not least, do not forget unit tests to verify your modification.
   


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