Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables dynamic catalog override functionality for Trino connections, allowing users to specify a different catalog in their job definition rather than being limited to the statically configured cluster catalog.
- Add optional
Catalogfield to job context for dynamic catalog specification - Implement catalog override logic that prioritizes job-level catalog over cluster-level catalog
- Update Trino request headers to use the resolved catalog value
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/pkg/object/command/trino/trino.go | Adds optional Catalog field to jobContext struct |
| internal/pkg/object/command/trino/client.go | Implements catalog override logic and updates request header usage |
| return nil, err | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
The code assumes clusterCtx.Catalog exists but there's no validation that clusterCtx is not nil or that the Catalog field is populated. This could result in an empty catalog being used if the cluster configuration is missing or incomplete.
Suggested change
| // Validate clusterCtx and its Catalog field | |
| if clusterCtx == nil || clusterCtx.Catalog == "" { | |
| return nil, fmt.Errorf("invalid cluster context: missing or empty Catalog") | |
| } |
Contributor
Author
|
It was decided to specify catalog name inside select * from catalog_name.schema.table_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trino allows connections to different RDS instances by configuring a separate catalog for each database. Each catalog can only connect to a single database. In current Heimdall implementation each cluster holds different catalog and as a result if a new Trino catalog was added new cluster and command should be added to config.
To improve the user experience, we propose allowing users to dynamically override the target catalog as part of the task definition, rather than statically configuring all catalogs in advance.
This enhancement was tested successfully on a local build.