feat: Web console: highlight NULLS FIRST / NULLS LAST and upgrade druid-query-toolkit to 1.7.0 #20621
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.55) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.55 · 629 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.386
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #20621"
general
weight: 0.35
gianm
Summary
<img width="532" height="146" alt="image" src="https://github.com/user-attachments/assets/6d5a7eed-fae7-457d-8723-82b63f4fbcf3" />
Three web console changes.
1.
NULLS FIRST/NULLS LASTin the SQL editor. These clauses already worked in Druid, but the editor showedNULLSandLASTas plain identifiers. Both are now keywords, so they are highlighted and autocompleted:Keyword suggestions can now also depend on the two keywords before the cursor, and a matching pair wins over the single keyword. Before, a keyword got the same suggestions everywhere. That made
NULLS FIRSTsuggestROW/ROWS(meant forFETCH FIRST), and had similar problems elsewhere:| After | Before | Now |
|---|---|---|
|
NULLS FIRST|ROW ROWS| nothing ||
GROUP BY|GROUPING ROLLUP CUBE ALL HOUR DAY MONTH YEAR|GROUPING ROLLUP CUBE||
PARTITIONED BY| (same 8) |ALL HOUR DAY MONTH YEAR||
ORDER BY,PARTITION BY,CLUSTERED BY| (same 8) | nothing ||
SELECT ALL|TIME| nothing ||
UNION ALL|TIME|SELECT||
SELECT DISTINCT,COUNT(DISTINCT|FROM| nothing ||
IS NOT| every keyword |DISTINCT||
LEFT/RIGHT/FULL OUTER| every keyword |JOIN||
CURRENT ROW|ONLY| nothing ||
EXPLAIN PLAN FOR| every keyword |SELECT INSERT REPLACE|FETCH FIRST→ROW ROWS,PARTITIONED BY ALL→TIMEandIS [NOT] DISTINCT→FROMare unchanged.2. druid-query-toolkit 1.2.2 → 1.7.0. The toolkit now uses
SqlQueryBaseas the common query type, so the console accepts it wherever any query form is fine:cell-filter-menu,preview-tableandresult-table-panenow takeSqlQueryBase.grouping-table-modulenarrows withinstanceof SqlQuerybefore callingchangeWhereExpression.3. Line numbers duplicating in the workbench editor. In a query like
… ORDER BY 2 DESC, typingNand deleting it again (repeatedly) turned the line number1into11,111, and so on. TypingNmakes the text parse only as a sub query, which adds a "run this query" button to line 1; deleting it removes the button. CodeMirror's gutter removes one node per marker, butSubQueryMarker.toDOMreturned a fragment of two nodes (the button and the line number), so the line number text was left behind each time:The code-editor README now notes that a gutter marker's
toDOMmust return a single node.Supporting changes for the toolkit upgrade:
tsconfig.json: adds"node"totypes. The 1.2.2 typings had a/// <reference types="node" />that leaked Node globals into the whole project, and the tests and e2e code depended on it without saying so.package.json: adds anoverridesentry so@istanbuljs/load-nyc-configusesjs-yaml@^4. This removessprintf-js, which has an advisory and no fixed release. That package only callsjs-yaml.load, which still exists in v4.Evidence
editor-languages.spec.tstokenizesORDER BY 2 DESC NULLS LAST, 1 NULLS FIRST.NULLS,LASTandFIRSTcome out asKeyword; before this change,NULLSandLASTwereIdentifier.sql-completions.spec.tscheck the suggestions:… DESC |→[NULLS],… DESC NULLS |→[FIRST, LAST], and… NULLS LAST |/… NULLS FIRST |→[]. They also check every row of the table above, plus the unchanged cases.sub-query-markers.spec.tstypesNand deletes it three times in a realEditorView, checking the line-1 number each time. Before the fix it read11; now it reads1.npm run test-base(eslint, sasslint, prettier, jest) passes, with 856 tests.tsc --noEmitand the production webpack build (npm run compile) also pass.npm audit: down from 26 issues to 7. All 7 remaining issues come frombraces(via stylelint and webpack-dev-server, both dev-only), andbraceshas no fixed version yet.Merge Danger
Door: two-way
Blast Radius: web-console
The changes are limited to the console's SQL editor and query-model typing, plus dev-only dependency resolution. Moving to toolkit 1.7.0 also changes SQL parsing and printing throughout the console (explore view, workbench, SQL data loader). The unit tests cover this, but the e2e suite was not run.
Release note
The web console's SQL editor now highlights and autocompletes
NULLS FIRST/NULLS LAST, and its keyword suggestions take the previous keyword into account (for exampleGROUP BYvsORDER BY). Also fixes line numbers in the workbench editor duplicating while typing.🤖 Generated with Claude Code