Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Trino column suggestions #282

Merged
merged 6 commits into from
Jan 31, 2025
Merged

Conversation

NikitaShkaruba
Copy link
Collaborator

No description provided.

@NikitaShkaruba NikitaShkaruba self-assigned this Jan 30, 2025
"test:yql": "node --experimental-vm-modules ./node_modules/.bin/jest --testPathIgnorePatterns tests/generated/.+ --verbose src/autocomplete/databases/yql/tests/",
"test:redis": "node --experimental-vm-modules ./node_modules/.bin/jest --testPathIgnorePatterns tests/generated/.+ --verbose src/autocomplete/databases/redis/tests/",
"test:trino": "node --experimental-vm-modules ./node_modules/.bin/jest --testPathIgnorePatterns tests/generated/.+ --verbose src/autocomplete/databases/trino/tests/",
"test:mongo": "node --experimental-vm-modules ./node_modules/.bin/jest --testPathIgnorePatterns tests/generated/.+ --verbose src/autocomplete/databases/mongo/tests/",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We'll have less parameters this way, much easier to modify

WHERE_ where = booleanExpression
)? # update
| MERGE_ INTO_ tableIdentifier (AS_? identifier)? USING_ relation ON_ expression mergeCase+ # merge
)?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need these statements separate, to be able to run my visitor on them

WHERE_ where = booleanExpression
)? (GROUP_ BY_ groupBy)? (HAVING_ having = booleanExpression)? (
WINDOW_ windowDefinition (COMMA_ windowDefinition)*
)?
;

fromClause
: FROM_ relation (COMMA_ relation)*
;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same as with insertStatement, I need to be able to run my visior on fromClause

: patternRecognition (TABLESAMPLE_ sampleType LPAREN_ percentage = expression RPAREN_)?
| tableIdentifier
: tableReference
| patternRecognition (TABLESAMPLE_ sampleType LPAREN_ percentage = expression RPAREN_)?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They need to be reversed, because patterRecognition can include almost anything, and we want to have tableReference in a priority

@@ -20,8 +20,6 @@ export interface TrinoAutocompleteResult extends SqlAutocompleteResult {
// TODO-TRINO: enrich autocomplete
suggestAggregateFunctions?: undefined;
suggestFunctions?: undefined;
suggestColumns?: undefined;
suggestColumnAliases?: undefined;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We properly support them now! :)

@NikitaShkaruba NikitaShkaruba merged commit 0785d15 into main Jan 31, 2025
4 checks passed
@NikitaShkaruba NikitaShkaruba deleted the trino_column_suggestions/0 branch January 31, 2025 12:38
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.

2 participants