You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "menghaoranss (via GitHub)" <gi...@apache.org> on 2026/04/07 10:25:11 UTC

[PR] Make SHOW UNLOADED SINGLE TABLES result order deterministic [shardingsphere]

menghaoranss opened a new pull request, #38594:
URL: https://github.com/apache/shardingsphere/pull/38594

   Changes proposed in this pull request:
   Summary
   This PR makes SHOW UNLOADED SINGLE TABLES return rows in a deterministic order.
   
   Previously, the result order depended on upstream metadata scan order, data source aggregation order, and map iteration order. That made the statement effectively "accidentally ordered" instead of explicitly ordered, which could cause unstable E2E assertions across different environments.
   
   Changes
   Add explicit sorting in ShowUnloadedSingleTablesExecutor
   Sort unloaded single table rows by:
   table_name
   storage_unit_name
   schema_name
   Keep the change localized to the executor layer without changing metadata loader or physical data source aggregation contracts
   Extend unit tests to cover deterministic ordering for:
   different table names
   same table name across different storage units
   same table name and storage unit across different schemas
   Motivation
   SHOW TABLES already applies explicit sorting, but SHOW UNLOADED SINGLE TABLES did not. As a result, the two statements behaved differently in practice, and CI was more likely to expose the nondeterministic ordering.
   
   This change aligns SHOW UNLOADED SINGLE TABLES with a stable, product-defined ordering rule and removes environment-dependent result ordering.
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   - [ ] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make SHOW UNLOADED SINGLE TABLES result order deterministic [shardingsphere]

Posted by "menghaoranss (via GitHub)" <gi...@apache.org>.
menghaoranss merged PR #38594:
URL: https://github.com/apache/shardingsphere/pull/38594


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make SHOW UNLOADED SINGLE TABLES result order deterministic [shardingsphere]

Posted by "menghaoranss (via GitHub)" <gi...@apache.org>.
menghaoranss commented on PR #38594:
URL: https://github.com/apache/shardingsphere/pull/38594#issuecomment-4198335008

   Merge Verdict: Mergeable
   
   Reviewed Scope: latest head 5cfd544c06e39528578b7607b8b3b958152a0799 of PR [#38594](https://github.com/apache/shardingsphere/pull/38594); ShowUnloadedSingleTablesExecutor.java (line 48), ShowUnloadedSingleTablesExecutorTest.java (line 69), and adjacent comparison path ShowSingleTablesExecutor.java (line 58).
   
   Not Reviewed Scope: full repo CI matrix and E2E execution under real heterogeneous storage-unit metadata sources.
   
   Need Expert Review: no.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org