irbull opened a new pull request, #30260:
URL: https://github.com/apache/flink/pull/30260
## What is the purpose of the change
Follow-up to #28790 (SHOW CONNECTIONS). `ShowConnectionsOperation` passes
the catalog and database straight to `CatalogManager.listConnections`, unlike
`ShowTablesOperation` and `ShowViewsOperation`. That leaves two gaps:
- **No current catalog:** plain `SHOW CONNECTIONS` fails with a bare
`NullPointerException: catalogName` instead of the usual "A current catalog has
not been set" `ValidationException`.
- **Missing database:** `SHOW CONNECTIONS FROM missing_db` relies on
`Catalog#listConnections` throwing `DatabaseNotExistException`. The default
`Catalog#listConnections` returns an empty list without checking, so on such
catalogs the statement silently shows nothing. `GenericInMemoryCatalog` does
check, which is why the existing test passes.
## Brief change log
- `ShowConnectionsOperation` qualifies the catalog and database with
`CatalogManager#qualifyCatalog` / `#qualifyDatabase`, as `ShowTablesOperation`
does.
- With `FROM`/`IN`, it checks `Catalog#databaseExists` before listing, using
the same message `CatalogManager#listConnections` uses: `Database '<db>' does
not exist in catalog '<cat>'.`
## Verifying this change
Two new cases in `ConnectionITCase` (batch and streaming), both failing
before this change:
- `testShowConnectionsRejectsMissingDatabaseInCatalogWithoutDatabaseCheck`:
a catalog whose `listConnections` returns an empty list without checking the
database.
- `testShowConnectionsRejectsMissingCurrentCatalog`: `SHOW CONNECTIONS` with
no current catalog.
```bash
./mvnw test -pl flink-table/flink-table-planner
-Dtest='ConnectionITCase,SqlConnectionOperationConverterTest'
```
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes (please specify the tool below)
Generated-by: Claude Code (Claude Opus 5.5)
--
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]