vogievetsky opened a new pull request, #20621:
URL: https://github.com/apache/druid/pull/20621
## Summary
Two web console changes.
**1. `NULLS FIRST` / `NULLS LAST` in the SQL editor.** These clauses already
worked in Druid, but the editor showed `NULLS` and `LAST` as plain identifiers.
Both are now keywords, so they are highlighted and autocompleted:
```diff
ORDER BY 2 DESC
- (no keyword suggestions after DESC)
+ suggests NULLS
+ NULLS → suggests FIRST, LAST
```
**2. druid-query-toolkit 1.2.2 → 1.7.0.** The toolkit now uses
`SqlQueryBase` as the common query type, so the console accepts it wherever any
query form is fine:
```diff
-parseSqlQuery(): SqlQuery | undefined // only SELECT / WITH
+parseSqlQuery(): SqlQueryBase | undefined // any query form, WITH
flattened
```
`cell-filter-menu`, `preview-table` and `result-table-pane` now take
`SqlQueryBase`. `grouping-table-module` narrows with `instanceof SqlQuery`
before calling `changeWhereExpression`.
Supporting changes:
- **`tsconfig.json`:** adds `"node"` to `types`. 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 an `overrides` entry so
`@istanbuljs/load-nyc-config` uses `js-yaml@^4`. This removes `sprintf-js`,
which has an advisory and no fixed release. That package only calls
`js-yaml.load`, which still exists in v4.
## Evidence
- **Highlighting:** a new test in `editor-languages.spec.ts` tokenizes
`ORDER BY 2 DESC NULLS LAST, 1 NULLS FIRST`. `NULLS`, `LAST` and `FIRST` come
out as `Keyword`; before this change, `NULLS` and `LAST` were `Identifier`.
- **Completion:** a new test in `sql-completions.spec.ts` checks the
suggestions: `… DESC |` → `[NULLS]`, `… DESC NULLS |` → `[FIRST, LAST]`, `…
NULLS LAST |` → `[]`.
- **Checks:** `npm run test-base` (eslint, sasslint, prettier, jest) passes,
with 854 tests. `tsc --noEmit` and the production webpack build (`npm run
compile`) also pass.
- **`npm audit`:** down from 26 issues to 7. All 7 remaining issues come
from `braces` (via stylelint and webpack-dev-server, both dev-only), and
`braces` has 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`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]