confluentinc / confluentinc/vscode
Provide helpful error message on Flink statement submission if the Kafka cluster doesn't match any available Flink compute pool cloud provider/region
- Dominant language
- TypeScript
- Stars
- 34
- Forks
- 17
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 8
Description
We need to add a basic `isFlinkQueryable` property to the `CCloudKafkaCluster` model, which would involve some extra logic around [here](https://github.com/confluentinc/vscode/blob/aee966c21bdbe830e093567c68408edd336cbf0b/src/graphql/ccloud.ts#L72-L108) to aggregate the Flink compute pool region/providers and properly flag Flink-queryable Kafka clusters.
The problem we might run into is a fully qualified topic/table name in the body of a Flink statement may include a Kafka topic that we don't expose through the normal "Set Catalog/Database" quickpick, and we end up seeing an error response like:
```
Error submitting statement: SQL validation failed. Error from line X1, column Y1 to line X2, column Y2. Caused by: Table (or view) '' does not exist, may be on a private cluster, or you do not have permission to access it. If the cluster is private, please connect using a private network. Using current catalog '' and current database '
```
Ideally we could catch this error response and check the cluster name against what we know about [topics' RBAC](https://github.com/confluentinc/vscode/blob/f03a65ced996dcd447acffd577039ad1b95540bf/src/models/topic.ts#L89-L98), [private networking](https://github.com/confluentinc/vscode/blob/main/src/utils/privateNetworking.ts), the presence of the cluster (via the [`CCloudResourceLoader`](https://github.com/confluentinc/vscode/blob/main/src/loaders/ccloudResourceLoader.ts)) to determine which of those error paths the response is hinting at, then decide to specifically float a "this cluster doesn't match any available Flink compute pool regions/providers" notification with a button that links to the environment in CCloud.
(from https://github.com/confluentinc/vscode/pull/2117#discussion_r2172084748)
Contributor guide
Assessment
This issue has not been assessed yet.