Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses Trino's incompatibility with semicolon-terminated SQL queries by implementing automatic semicolon removal in the Trino plugin. The change ensures that queries sent to Trino clusters will not fail due to trailing semicolons.
- Adds query normalization to remove trailing semicolons before sending queries to Trino
- Implements a dedicated function to handle the semicolon removal logic
Comments suppressed due to low confidence (1)
internal/pkg/object/command/trino/client.go:182
- The normalizeTrinoQuery function lacks test coverage. Consider adding unit tests to verify it correctly removes trailing semicolons and handles edge cases like empty strings, strings with only semicolons, and strings without trailing semicolons.
func normalizeTrinoQuery(query string) string {
sanketjadhavSF
previously approved these changes
Jul 23, 2025
a1fb311 to
642966a
Compare
sanketjadhavSF
approved these changes
Jul 23, 2025
alephys26
approved these changes
Jul 23, 2025
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 doesn't like semicolon at the end. That is why some errors happens.
Exception: Heimdall Job failed: query failed: line 10:4: mismatched input ';'. Expecting: '(', ',', 'CROSS', 'EXCEPT', 'FETCH', 'FULL', 'GROUP', 'HAVING', 'INNER', 'INTERSECT', 'JOIN', 'LEFT', 'LIMIT', 'MATCH_RECOGNIZE', 'NATURAL', 'OFFSET', 'ORDER', 'RIGHT', 'TABLESAMPLE', 'UNION', 'WHERE', 'WINDOW', <EOF>To prevent that trino plugin in heimdall will always remove semicolon from the end