FrankChen021 commented on code in PR #20621:
URL: https://github.com/apache/druid/pull/20621#discussion_r4302630381
##########
web-console/src/editor-completions/sql-completions.ts:
##########
@@ -100,6 +104,9 @@ const SQL_KEYWORD_FOLLOW_SUGGESTIONS: Record<string,
string[]> = {
GROUPING: ['SETS'],
FETCH: ['FIRST', 'NEXT'],
FIRST: ['ROW', 'ROWS'],
+ ASC: ['NULLS'],
+ DESC: ['NULLS'],
+ NULLS: ['FIRST', 'LAST'],
Review Comment:
[P2] Suppress FETCH suggestions after NULLS FIRST
**Finding:** At ORDER BY ... NULLS FIRST |, keywordBeforePrefix is FIRST, so
the generic follow-suggestion map selects the existing FIRST: ['ROW', 'ROWS']
entry. ROW and ROWS are appropriate for FETCH FIRST but invalid after NULLS
FIRST, so the new completion path offers choices that produce malformed SQL.
**Suggestion:** Make follow-up suggestions aware of the preceding NULLS
context, or suppress the FETCH-specific FIRST suggestions there, and add a
regression test for NULLS FIRST while retaining FETCH FIRST coverage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]