Baymine opened a new pull request, #66080:
URL: https://github.com/apache/doris/pull/66080

   ### What problem does this PR solve?
   
   Issue Number: close #66079
   
   Problem Summary:
   
   `SHOW TABLES` on an external catalog iterated `dbIf.getTables()`, which
   eagerly initializes every table via the meta cache (one `getTableNullable()`
   -> remote metadata load per table). For catalogs with many tables this turned
   a cheap name listing into N remote loads.
   
   This adds a fast path for the common case only -- a non-verbose `SHOW TABLES`
   on an external catalog -- that lists names via
   `dbIf.getTableNamesOrEmptyWithLock()` without initializing any table. The
   per-table `SHOW` privilege filter is preserved (it is name-based and needs no
   table load), so no table name is leaked to a user who lacks `SHOW` on it.
   
   Everything else keeps the original `getTables()` loop unchanged:
   - Internal-catalog `SHOW TABLES` / `SHOW FULL TABLES`.
   - External-catalog `SHOW FULL TABLES` (verbose): it still needs 
`getMysqlType()`
     and the storage-format columns, so it takes the original path and its
     4-column output (`Table_type`, `Storage_format`,
     `Inverted_index_storage_format`) is unchanged.
   - `SHOW VIEWS` (needs `getEngine()` to filter views) and `SHOW STREAMS`.
   
   ### Release note
   
   None (performance optimization; `SHOW TABLES` output for accessible tables is
   unchanged, `SHOW FULL TABLES` / `SHOW VIEWS` are unaffected).
   
   ### Check List (For Author)
   
   - Test:
       - Manual test on a live cluster with an HMS catalog: `SHOW TABLES` and
         `SHOW TABLES LIKE` list names via the fast path; `SHOW FULL TABLES`
         returns the correct 4 columns (name, `Table_type`, `Storage_format`,
         `Inverted_index_storage_format`) with no column mismatch.
       - Ran existing `ShowTableCommandTest` (2 passed); FE build (`build.sh 
--fe`)
         + checkstyle green.
       - No new unit test: exercising the external-catalog branch needs an
         ExternalCatalog with a working `getTableNamesOrEmptyWithLock()`, which 
is
         not available in the FE unit-test harness; a portable regression `.out`
         needs the docker HMS test environment.
   - Behavior changed: No material change (a non-loadable external table's name 
is
     now listed by `SHOW TABLES` where the old path silently omitted it on load
     failure, which is arguably more correct).
   - Does this need documentation: 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to