shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

hope to support with count sub query sql

Open lazeyliu opened this issue 7 years ago • 7 comments

Bug Report

For English only, other languages will not accept. SQL:

SELECT COUNT(1) FROM ( 
     SELECT
        r.`channel` as `channel_code`,
        r.`channel_name` as `channel_name`,
        COUNT(r.id) `total_cnt`,
        COUNT(r.connect_flag = "Y") `connected_cnt`
        FROM record_callin r
        LEFT JOIN sys_org_tree_rel tree ON tree.teamid = r.teamid
        LEFT JOIN sys_user u ON u.brokerid = r.brokerid
        where
        r.create_time between '2018-01-01 00:00:00' and   '2019-01-01 00:00:00'
        GROUP BY 
        r.`channel` 
) TOTAL

hope to support it

lazeyliu avatar Jan 15 '19 03:01 lazeyliu

does not support subquery without sharding column in where condition

codefairy08 avatar Jan 25 '19 02:01 codefairy08

@codefairy08 We should support this kind of SQL, it is a regression. ShardingSphere support it before.

terrymanu avatar Feb 14 '19 15:02 terrymanu

FIY: https://shardingsphere.apache.org/document/current/en/features/sharding/use-norms/sql/

search Available for not only sub-query of pagination

terrymanu avatar Feb 14 '19 15:02 terrymanu

fixed at #1873

terrymanu avatar Feb 18 '19 14:02 terrymanu

Not finished yet, it need to support route to multiple tables

terrymanu avatar Feb 20 '19 04:02 terrymanu

When can this problem be fixed, our technical research sharding-jdbc is blocked by this problem

JeddyHj avatar Feb 25 '19 09:02 JeddyHj

I am sorry, but we can not promise it. If you have requirement, do you mind try to submit a pull request?

terrymanu avatar Feb 25 '19 15:02 terrymanu