Skip to content

Ihladush/update trino#28

Merged
hladush merged 3 commits intomainfrom
ihladush/update_trino
Jul 23, 2025
Merged

Ihladush/update trino#28
hladush merged 3 commits intomainfrom
ihladush/update_trino

Conversation

@hladush
Copy link
Contributor

@hladush hladush commented Jul 23, 2025

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
sanketjadhavSF previously approved these changes Jul 23, 2025
@hladush hladush merged commit 3d4270f into main Jul 23, 2025
5 checks passed
@hladush hladush deleted the ihladush/update_trino branch July 23, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants