Qualify bare * and add table alias in Exasol Sqlglot #6431
+56
−1
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.
What motivated this PR?
Exasol doesn't support a bare * alongside other select items.
How is the existing logic in main incorrect?
For example, when transpiling
SELECT *, 1 FROM TESTto Exasol, the query returned (SELECT *, 1 FROM TEST) would fail because Exasol requires that the bare * is scoped with an alias.How does the PR address the aforementioned issues?
The PR preprocesses SELECT by transforming unscoped star to .* and attaching TableAlias.
Fix:
SELECT *, 1 FROM TEST->SELECT T.*, 1 FROM TEST AS TProvide documentation for the SQL functions involved in the implementation & explain whether semantics change / are preserved
The issue is not specifically stated in the documentation, but I can provide a screenshot if required