Gabriel39 opened a new pull request, #69252: URL: https://github.com/apache/doris/pull/69252
### What problem does this PR solve? Problem Summary: `USE example_db` can report `Unknown database` when the external catalog actually failed to initialize or list databases because of Kerberos authentication or a remote connection failure. Two catch-and-return-null paths discard the real failure, making an existing database appear absent. Let initialization and database-discovery errors propagate with their original causes. A successful lookup that does not contain the requested database still returns null. Tests also verify that the same catalog can retry successfully after a discovery failure. Kerberos realm mapping remains deployment configuration: catalogs sharing Hadoop authentication state need compatible rules at first initialization. This change makes failures visible; it does not replace that configuration requirement. ### Release note Report external catalog initialization and database-discovery errors instead of incorrectly reporting a missing database. ### Check List (For Author) - [x] Unit Test - [x] Manual test - Behavior changed: database lookup preserves authentication/connection errors; genuine missing databases retain their previous behavior. - Documentation needed: No new configuration or API. Validation: - Both new tests reproduced the swallowed-error behavior before the fix. - Local SQL validation used the original failing runtime with the compiled ExternalCatalog classes patched into its FE jar. With incompatible realm mapping, all three previously misleading database lookups reported the underlying `NoMatchingRule` error rather than `Unknown database`. - After restarting FE and initializing both connectors with compatible mapping rules, all three database lookups succeeded. An actually absent database still reported `Unknown database`. - These live checks cover authentication/database discovery, not the complete migration or ORC test bodies. This PR does not change Hadoop's shared authentication state or claim to fix unrelated credential failures. - Full `ExternalCatalogTest` and `ExternalDatabaseTest`: 85 tests, zero failures/errors/skips. FE Checkstyle passed with zero violations. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label -- 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]
