fix(pretty-print): print SET headers on their own line in multiline - #248
Merged
Merged
Conversation
Multiline and pipe-multiline glued SET onto the source command with a space, unlike wrapping and the documented ES|QL layout.
sddonne
approved these changes
Sep 16, 2026
sddonne
left a comment
Contributor
There was a problem hiding this comment.
LGTM, I think it makes sense for pipe-multiline to apply to header commands too (even if they don't use pipes).
Contributor
Author
|
@sddonne thank you for reviewing the PR. Could you merge it, as I don't have write permissions to the repo. |
sddonne
enabled auto-merge (squash)
September 16, 2026 11:28
This was referenced Sep 16, 2026
Merged
momovdg
pushed a commit
that referenced
this pull request
Sep 18, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @elastic/esql-grammar@4.26.0 ### Minor Changes - [#249](#249) [`18334b7`](18334b7) Thanks [@momovdg](https://github.com/momovdg)! - Add `DENSE_VECTOR` output-naming support, following the latest Elasticsearch grammar. Two new forms now parse, and round-trip through the pretty-printer: - `DENSE_VECTOR target = field` — an explicit output column name, exposed as `targetField` - `DENSE_VECTOR suffix = "_dv" ON a, b` — a shared output-name suffix, exposed as `suffix`, with the input fields carried on an `on` option The grammar also makes the field list optional, which previously caused the CST to AST conversion to throw on queries such as `FROM logs | DENSE_VECTOR` and discard the whole AST. Those queries now convert to an incomplete command. That same grammar accepts a string literal where a field name is expected, as in `FROM books | DENSE_VECTOR "the quick brown fox"`. Elasticsearch rejects these queries with a `parsing_exception`, so the converter builds no command parts for them: the command is marked `incomplete` with no arguments, fields, target field or named parameters, and any trailing `WITH` clause is dropped. ## @elastic/esql-parser@4.26.0 ### Minor Changes - [#249](#249) [`18334b7`](18334b7) Thanks [@momovdg](https://github.com/momovdg)! - Add `DENSE_VECTOR` output-naming support, following the latest Elasticsearch grammar. Two new forms now parse, and round-trip through the pretty-printer: - `DENSE_VECTOR target = field` — an explicit output column name, exposed as `targetField` - `DENSE_VECTOR suffix = "_dv" ON a, b` — a shared output-name suffix, exposed as `suffix`, with the input fields carried on an `on` option The grammar also makes the field list optional, which previously caused the CST to AST conversion to throw on queries such as `FROM logs | DENSE_VECTOR` and discard the whole AST. Those queries now convert to an incomplete command. That same grammar accepts a string literal where a field name is expected, as in `FROM books | DENSE_VECTOR "the quick brown fox"`. Elasticsearch rejects these queries with a `parsing_exception`, so the converter builds no command parts for them: the command is marked `incomplete` with no arguments, fields, target field or named parameters, and any trailing `WITH` clause is dropped. ### Patch Changes - Updated dependencies [[`0df48e7`](0df48e7), [`18334b7`](18334b7)]: - @elastic/esql-definitions@4.26.0 - @elastic/esql-types@4.26.0 - @elastic/esql-promql-grammar@4.26.0 - @elastic/esql-traversal@4.26.0 - @elastic/esql-ast@4.26.0 ## @elastic/esql-types@4.26.0 ### Minor Changes - [#249](#249) [`18334b7`](18334b7) Thanks [@momovdg](https://github.com/momovdg)! - Add `DENSE_VECTOR` output-naming support, following the latest Elasticsearch grammar. Two new forms now parse, and round-trip through the pretty-printer: - `DENSE_VECTOR target = field` — an explicit output column name, exposed as `targetField` - `DENSE_VECTOR suffix = "_dv" ON a, b` — a shared output-name suffix, exposed as `suffix`, with the input fields carried on an `on` option The grammar also makes the field list optional, which previously caused the CST to AST conversion to throw on queries such as `FROM logs | DENSE_VECTOR` and discard the whole AST. Those queries now convert to an incomplete command. That same grammar accepts a string literal where a field name is expected, as in `FROM books | DENSE_VECTOR "the quick brown fox"`. Elasticsearch rejects these queries with a `parsing_exception`, so the converter builds no command parts for them: the command is marked `incomplete` with no arguments, fields, target field or named parameters, and any trailing `WITH` clause is dropped. ## @elastic/esql@4.26.0 ### Patch Changes - [#248](#248) [`960bf20`](960bf20) Thanks [@awahab07](https://github.com/awahab07)! - Print SET header commands on their own line in multiline and pipe-multiline output - Updated dependencies [[`0df48e7`](0df48e7), [`18334b7`](18334b7)]: - @elastic/esql-definitions@4.26.0 - @elastic/esql-grammar@4.26.0 - @elastic/esql-types@4.26.0 - @elastic/esql-parser@4.26.0 - @elastic/esql-promql-grammar@4.26.0 - @elastic/pretty-printer@4.26.0 - @elastic/esql-traversal@4.26.0 - @elastic/esql-ast@4.26.0 ## @elastic/esql-ast@4.26.0 ### Patch Changes - Updated dependencies [[`0df48e7`](0df48e7), [`18334b7`](18334b7)]: - @elastic/esql-definitions@4.26.0 - @elastic/esql-grammar@4.26.0 - @elastic/esql-types@4.26.0 - @elastic/esql-promql-grammar@4.26.0 ## @elastic/esql-definitions@4.26.0 ### Patch Changes - [#246](#246) [`0df48e7`](0df48e7) Thanks [@momovdg](https://github.com/momovdg)! - Add `DENSE_VECTOR` to `processingCommandNames` so it is highlighted as a command keyword in TextMate, Monaco, Prism.js, and Highlight.js grammars ## @elastic/elasticsearch-esql-dsl@4.26.0 ### Patch Changes - Updated dependencies []: - @elastic/elasticsearch-query-builder@4.26.0 ## @elastic/esql-traversal@4.26.0 ### Patch Changes - Updated dependencies [[`18334b7`](18334b7)]: - @elastic/esql-types@4.26.0 - @elastic/esql-ast@4.26.0 ## @elastic/highlightjs-esql@4.26.0 ### Patch Changes - Updated dependencies [[`0df48e7`](0df48e7)]: - @elastic/esql-definitions@4.26.0 ## @elastic/monaco-esql@4.26.0 ### Patch Changes - Updated dependencies [[`0df48e7`](0df48e7)]: - @elastic/esql-definitions@4.26.0 ## @elastic/prismjs-esql@4.26.0 ### Patch Changes - Updated dependencies [[`0df48e7`](0df48e7)]: - @elastic/esql-definitions@4.26.0 ## @elastic/textmate-esql@4.26.0 ### Patch Changes - [#246](#246) [`0df48e7`](0df48e7) Thanks [@momovdg](https://github.com/momovdg)! - Add `DENSE_VECTOR` to `processingCommandNames` so it is highlighted as a command keyword in TextMate, Monaco, Prism.js, and Highlight.js grammars - Updated dependencies [[`0df48e7`](0df48e7)]: - @elastic/esql-definitions@4.26.0 ## @elastic/esql-promql-grammar@4.26.0 ## @elastic/pretty-printer@4.26.0 ## @elastic/elasticsearch-query-builder@4.26.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Print each
SETheader on its own line in multiline /pipe-multiline.Those formats previously glued
SETonto the source command with a space.Matches SET and Discover Prettify:
Details
print('basic')andtoRequest()stay a single line (SET …; TS …).pipe-multilinestill does not wrap inside commands (STATS … BYstays on one line).SETlayout; this only changesBasicPrettyPrintermultiline.Checklist
yarn changeset) if this change should be released. See docs/RELEASE.md.BREAKING CHANGE: changesyntax and selected amajorbump in the changeset.