kimmking commented on issue #4597: fix #4565 for distinct bug URL: https://github.com/apache/incubator-shardingsphere/pull/4597#issuecomment-594439444 ``` ================= >Case5: distinct with groupby&orderby other columns ========> [INFO ] 2020-03-04 17:39:02,517 --main-- [ShardingSphere-SQL] Rule Type: sharding [INFO ] 2020-03-04 17:39:02,517 --main-- [ShardingSphere-SQL] Logic SQL: select distinct age from user group by name order by id [INFO ] 2020-03-04 17:39:02,517 --main-- [ShardingSphere-SQL] SQLStatement: SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@1436a7ab, tablesContext=org.apache.shardingsphere.sql.parser.relation.segment.table.TablesContext@3b7b05a8), tablesContext=org.apache.shardingsphere.sql.parser.relation.segment.table.TablesContext@3b7b05a8, projectionsContext=ProjectionsContext(startIndex=16, stopIndex=18, distinctRow=true, projections=[ColumnProjection(owner=null, name=age, alias=Optional.empty), DerivedProjection(expression=name, alias=Optional[GROUP_BY_DERIVED_0]), DerivedProjection(expression=id, alias=Optional[ORDER_BY_DERIVED_0])], columnLabels=[age]), groupByContext=org.apache.shardingsphere.sql.parser.relation.segment.select.groupby.GroupByContext@3d36dff4, orderByContext=org.apache.shardingsphere.sql.parser.relation.segment.select.orderby.OrderByContext@7abe27bf, paginationContext=org.apache.shardingsphere.sql.parser.relation.segment.select.pagination.PaginationContext@5b94ccbc, containsSubquery=false) [INFO ] 2020-03-04 17:39:02,518 --main-- [ShardingSphere-SQL] Actual SQL: ds_0 ::: select distinct age , name AS GROUP_BY_DERIVED_0 , id AS ORDER_BY_DERIVED_0 from user0 group by name order by id [INFO ] 2020-03-04 17:39:02,518 --main-- [ShardingSphere-SQL] Actual SQL: ds_0 ::: select distinct age , name AS GROUP_BY_DERIVED_0 , id AS ORDER_BY_DERIVED_0 from user1 group by name order by id [INFO ] 2020-03-04 17:39:02,518 --main-- [ShardingSphere-SQL] Actual SQL: ds_0 ::: select distinct age , name AS GROUP_BY_DERIVED_0 , id AS ORDER_BY_DERIVED_0 from user2 group by name order by id [INFO ] 2020-03-04 17:39:02,518 --main-- [ShardingSphere-SQL] Actual SQL: ds_1 ::: select distinct age , name AS GROUP_BY_DERIVED_0 , id AS ORDER_BY_DERIVED_0 from user0 group by name order by id [INFO ] 2020-03-04 17:39:02,518 --main-- [ShardingSphere-SQL] Actual SQL: ds_1 ::: select distinct age , name AS GROUP_BY_DERIVED_0 , id AS ORDER_BY_DERIVED_0 from user1 group by name order by id [INFO ] 2020-03-04 17:39:02,518 --main-- [ShardingSphere-SQL] Actual SQL: ds_1 ::: select distinct age , name AS GROUP_BY_DERIVED_0 , id AS ORDER_BY_DERIVED_0 from user2 group by name order by id [11] [11] [11] [15] [11] [11] [12] [13] [11] [12] [13] [14] ```
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
