ESQL: Document the FILLNULL command #167356
Pinging @elastic/es-analytical-engine (Team:Analytics)
Severity: P3 (Low)
Binding a query parameter to null fails with a parsing error; it does not make FILLNULL a no-op. Clarify that callers must write the NULL keyword in the query itself to request a no-op.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
Severity: P3 (Low)
A bare targets user columns, not metadata columns such as _index and _score. The later note describes this only after a union or FORK, but the exclusion also applies to metadata from an ordinary FROM. State the rule where is defined so users know when to add a metadata column explicitly.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
Severity: P3 (Low)
Explain that columns of type null, such as those created by ROW a = null, are skipped even with an explicit fill value. Readers adapting the example need to know why it casts each column before filling it: without the cast, the query succeeds with a warning but leaves the column null.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
Severity: P3 (Low)
“To fill one of those, provide an explicit value instead” is not true for all the listed types. For example, a geo_point stays null even when given an explicit WKT point string. Distinguish types that accept an explicit replacement, such as dates and IPs, from types that FILLNULL cannot fill.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
Severity: P3 (Low)
Distinguish an incompatible fill value from a target that cannot be resolved. An unknown column or a wildcard pattern that matches nothing fails verification, even if * appears in the same list; it is not skipped with a warning.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
Severity: P3 (Low)
Document the per-query column limit alongside the ON * guidance. If the FILLNULL commands together would fill more than the configured limit (1,000 columns by default), the query is rejected rather than filling a subset. Naming only the needed columns or narrowing the input beforehand avoids that failure.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
✅ Elastic Docs Style Checker (Vale)
No issues found on modified lines!
---
The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.
<!-- Sticky Pull Request Commentelastic-vale-results -->
ℹ️ Important: Docs version tagging
👋 Thanks for updating the docs! Elastic docs cover multiple versions and deployment types on the same page. applies_to tags help readers understand which information applies to them.
⚠️ Don't remove or replace information that applies to an older version.
Need help with applies_to?
applies_to metadata, with syntax examples.The automated docs review also checks for tagging issues on your PR, where enabled.
The list entry uses stack: ga 9.7 (no +), but the page itself says ga 9.7+. Without the + the badge reads as 9.7 only. Since the command goes straight to GA in 9.7, should this be 9.7+?
* [`FILLNULL`](/reference/query-languages/esql/commands/fillnull.md) {applies_to}`stack: ga 9.7+` {applies_to}`serverless: ga`
Good catch — applied in 26c41ceb9244, it's ga 9.7+ now (the command goes straight to GA in 9.7).
Thanks for the review. Addressed the Libra comments on the fillnull.md layout snippet in 26c41ceb9244 (and kosabogi's badge suggestion in the same commit). I verified each point against the code/csv-spec first:
NULL / query parameter — confirmed in LogicalPlanBuilder#visitFillNullCommand: a null-bound ?param throws ParsingException ("use FILLNULL NULL to leave nulls unchanged"). Reworded so the NULL keyword is the documented no-op and a null-resolving parameter is called out as an error. and metadata* — stated at the definition that targets only the query's own columns and never metadata (_index, _score), even from an ordinary FROM; name a metadata column explicitly to target it.null-typed columns — added that a column with no concrete type (e.g. ROW a = null) is left unchanged even with an explicit value, and must be cast first.datetime, date_nanos, ip, version still accept an explicit (string) value, whereas spatial types (e.g. geo_point), ranges, histograms, counters and aggregate_metric_double cannot be filled at all.), while a resolved-but-type-incompatible column is skipped with a warning.esql.query.max_fillnull_fields (1,000 by default, counting every FILLNULL incl. FORK branches / view references) and the advice to name columns or KEEP/DROP before ON *.Docs built clean with docs-builder.
Severity: P3 (Low)
A metadata column does not have to be named exactly: a pattern such as _ind can also target _index and fill its nulls. Clarify that the exclusion applies to bare , so readers don't assume other wildcard patterns also leave metadata untouched.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
Severity: P3 (Low)
Qualify the unknown-name error with the unmapped_fields setting. With LOAD_ALL, FILLNULL "missing" ON no_such_field can succeed and produce a filled column even when no document has that field, so a missing field name is not always a verification error.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
Severity: P3 (Low)
An IN subquery gets its own esql.query.max_fillnull_fields budget. The current wording implies that the outer query and its IN subqueries are rejected when their combined count exceeds the limit, but they can succeed if each stays within its own limit.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
Resolved by 26c41ceb92446bb0807d7fc8803fd75ed2eeeff9
Resolved by 26c41ceb92446bb0807d7fc8803fd75ed2eeeff9
Resolved by 26c41ceb92446bb0807d7fc8803fd75ed2eeeff9
Resolved by 26c41ceb92446bb0807d7fc8803fd75ed2eeeff9
Resolved by 26c41ceb92446bb0807d7fc8803fd75ed2eeeff9
Resolved by 26c41ceb92446bb0807d7fc8803fd75ed2eeeff9
Thanks — addressed the three follow-up Libra comments in ecd0c5900c40 (verified against the code first):
* only; a metadata column can be targeted by naming it or by a wildcard pattern that matches it (e.g. _ind for _index).unmapped_fields (line 36) — qualified that the verification error assumes the default unmapped-field handling; with SET unmapped_fields=LOAD/LOAD_ALL a name absent from the mapping resolves as an unmapped column that FILLNULL can fill. Linked to the unmapped-fields page.IN subquery budget (line 40) — reworded: the limit covers the FILLNULL commands of a single query (incl. FORK branches and view references), and an IN subquery runs as its own query with its own budget, so it isn't added to the outer total. This matches the esql.query.max_fillnull_fields javadoc in EsqlFlags.Docs built clean with docs-builder (new unmapped-fields link resolves).
Severity: P3 (Low)
Qualify the LOAD and LOAD_ALL exception: loading an unmapped field at the source does not make it available after a STATS that doesn't output it. A FILLNULL targeting that field after STATS still fails with Unknown column, contrary to the new guarantee that it resolves.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
Resolved by ecd0c5900c406060e7353ea0f84c2ea2b5bc72b3
Resolved by ecd0c5900c406060e7353ea0f84c2ea2b5bc72b3
Resolved by ecd0c5900c406060e7353ea0f84c2ea2b5bc72b3
Good point — qualified in 7cbd80bab23b. The note now says LOAD/LOAD_ALL resolves an absent-from-mapping name only while the column is still in FILLNULL's input (loaded at the source), and that a name an earlier command dropped — e.g. a STATS that does not output it — still fails as an unknown column.
Severity: P3 (Low)
ON does not exclude columns just because their names start with _. For example, a query-created _score is fillable by ON even after a FORK. Describe the exclusion in terms of metadata and other internal columns, not the name prefix; otherwise readers may rely on * to leave a column untouched when it actually replaces its nulls.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
This describes the behaviour after #167796, which makes a bare * skip every column whose name starts with an underscore, including a _score made by the query. The two should land together, or #167796 first.
Agreed on the dependency: this documentation says bare * skips underscore-prefixed columns, including query-created ones (lines 24–26). This commit’s diff adds the documentation and examples, not the behavior change, so the docs should land with #167796 or after it. I haven’t independently verified #167796’s implementation.
<sub>Generated by Libra. React with 👍 or 👎 to give feedback on this comment.</sub>
LGTM
Hi @kosabogi, could you take another look please?
LGTM, thank you!
astefan
edsavage
Summary
Adds the reference documentation for the
FILLNULLprocessing command, which goes GA in 9.7 (it was snapshot-only until now, never publicly in preview, so it is documented straight to GA — the same shape asDESCRIBEin this release)._snippets/commands/layout/fillnull.md— syntax, parameters, description, and examples. Page badgestack: ga 9.7+/serverless: ga.commands/fillnull.md._snippets/lists/processing-commands.md(GA 9.7).fillnull.csv-spec(fillNullOnMVField,fillNullAllFieldsMixedTypeDefaults) as doc examples and included the generated snippets produced byCommandDocsTests.Built locally with
docs-builder: the FILLNULL pages render and no errors reference them.Independent of the de-gate PRs (#167348 / #167349); docs-builder sanitizes the unreleased 9.7 badge to "Planned for a future release" until 9.7 ships.
Closes #163218