hutiefang76 opened a new issue, #4409:
URL: https://github.com/apache/amoro/issues/4409

   ### What happened?
   
   `TableController.getTableList` sorts managed entries by type and name before 
appending unmanaged Hive entries. In a Hive catalog containing a managed 
Iceberg table and an unmanaged Hive table, the response puts ICEBERG before 
HIVE, contrary to the comparator applied to the managed list. The combined 
response should use the same type/name order.
   
   ### Affects Versions
   
   Reproduced on master at `9442f8c`. Released versions have not been checked.
   
   ### What table formats are you seeing the problem on?
   
   Mixed-Hive, Iceberg and unmanaged Hive tables
   
   ### What engines are you seeing the problem on?
   
   AMS
   
   ### How to reproduce
   
   1. Use a Hive catalog where `ServerCatalog.listTables` returns `iceberg_a` 
with format ICEBERG.
   2. Have HMS return an unmanaged table named `hive_a`.
   3. Call `TableController.getTableList` for the database.
   4. The response order is `iceberg_a:ICEBERG, hive_a:HIVE`; applying the 
existing type/name comparator to the combined list gives `hive_a:HIVE, 
iceberg_a:ICEBERG`.
   
   The regression test calls the actual controller and captures its response, 
mocking catalog access and the HMS lookup.
   
   ### Relevant log output
   
   The combined-list and keyword-filtered order assertions fail on the original 
implementation.
   
   ### Anything else
   
   Proposed fix: Move the existing type/name comparator after managed and 
unmanaged Hive entries have been combined. Cover combined ordering, 
managed-name deduplication, keyword filtering and non-Hive catalogs.
   
   Code was assisted by DeepSeek v4 Flash via Reasonix 1.39.4; submission text 
was assisted by Codex. The patch and local test results were reviewed.
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's Code of Conduct
   


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