← Back to Pull requests

ESQL: Document the FILLNULL command #167356

Merged
edsavage merged 7 files (93 lines) on Dec 01, 2026 20:30 UTC
View on GitHub
edsavage edsavage commented on Nov 24, 2026 23:52 UTC
Author

Summary

Adds the reference documentation for the FILLNULL processing 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 as DESCRIBE in this release).

  • Layout snippet _snippets/commands/layout/fillnull.md — syntax, parameters, description, and examples. Page badge stack: ga 9.7+ / serverless: ga.

  • Wrapper page commands/fillnull.md.

  • List entry in _snippets/lists/processing-commands.md (GA 9.7).

  • toc.yml entry under processing commands.

  • Tested examples: tagged two existing passing tests in fillnull.csv-spec (fillNullOnMVField, fillNullAllFieldsMixedTypeDefaults) as doc examples and included the generated snippets produced by CommandDocsTests.
  • 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

    Diff: 93 lines (+93 / -0) across 7 files Reviewer: astefan Review duration: 9878m
    All Vouch review confidence checks passed
    Residual risk 0.03 = Change Risk (0.39) × (1 − Review Confidence (0.92)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 93 lines diff across 7 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.93 · 5 substantive comment(s)
    0.93
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    92%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.272
    Real PR Conversation Timeline
    35 items
    elasticsearchmachine elasticsearchmachine commented on Nov 24, 2026 23:52 UTC
    Contributor

    Pinging @elastic/es-analytical-engine (Team:Analytics)

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 24, 2026 23:54 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.

    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>

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 24, 2026 23:54 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.

    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>

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 24, 2026 23:54 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns.

    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>

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 24, 2026 23:54 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Types that have no default, such as dates, `ip`, `version`, spatial types, ranges, histograms, counter fields, and `aggregate_metric_double`, are left unchanged, with a warning. To fill one of those, provide an explicit value instead.

    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>

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 24, 2026 23:54 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Types that have no default, such as dates, `ip`, `version`, spatial types, ranges, histograms, counter fields, and `aggregate_metric_double`, are left unchanged, with a warning. To fill one of those, provide an explicit value instead.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`: a column whose type the value does not fit is skipped with a warning rather than failing the query. Listing `*` together with a name or pattern still targets every column.

    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>

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 24, 2026 23:54 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Types that have no default, such as dates, `ip`, `version`, spatial types, ranges, histograms, counter fields, and `aggregate_metric_double`, are left unchanged, with a warning. To fill one of those, provide an explicit value instead.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`: a column whose type the value does not fit is skipped with a warning rather than failing the query. Listing `*` together with a name or pattern still targets every column.
    +
    +When `ON *` runs after a union of sources, such as a multi-index or subquery [`FROM`](/reference/query-languages/esql/commands/from.md) or a [`FORK`](/reference/query-languages/esql/commands/fork.md), a metadata column such as `_index` that is null on some rows is left alone. Name it explicitly to fill it.
    +
    +## Examples
    +
    +Replace the nulls in a single column with a value, leaving the rows that already have a value untouched:
    +
    +:::{include} ../../generated/x-pack-esql/commands/examples/fillnull.csv-spec/onColumnForDocs.md
    +:::
    +
    +Fill every column with the default for its type using `DEFAULT ON *`:

    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>

    github-actions[bot] github-actions[bot] commented on Nov 24, 2026 23:54 UTC
    Bot
    github-actions[bot] github-actions[bot] commented on Nov 24, 2026 23:54 UTC
    Bot

    ✅ 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 -->

    github-actions[bot] github-actions[bot] commented on Nov 24, 2026 23:56 UTC
    Bot

    ℹ️ 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?

  • Tagging skill: Identify, generate, update, and validate tags.

  • Placement guide: Where to put applies_to metadata, with syntax examples.
  • The automated docs review also checks for tagging issues on your PR, where enabled.

    kosabogi kosabogi commented on code on Nov 25, 2026 09:41 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/lists/processing-commands.md:1
    @@ -7,6 +7,7 @@
     * [`DROP`](/reference/query-languages/esql/commands/drop.md)
     * [`ENRICH`](/reference/query-languages/esql/commands/enrich.md)
     * [`EVAL`](/reference/query-languages/esql/commands/eval.md)
    +* [`FILLNULL`](/reference/query-languages/esql/commands/fillnull.md) {applies_to}`stack: ga 9.7` {applies_to}`serverless: ga`

    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`
    

    edsavage edsavage commented on code on Nov 25, 2026 22:06 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/lists/processing-commands.md:1
    @@ -7,6 +7,7 @@
     * [`DROP`](/reference/query-languages/esql/commands/drop.md)
     * [`ENRICH`](/reference/query-languages/esql/commands/enrich.md)
     * [`EVAL`](/reference/query-languages/esql/commands/eval.md)
    +* [`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).

    edsavage edsavage commented on Nov 25, 2026 22:07 UTC
    Author

    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.

  • DEFAULT vs explicit value — split the no-default types: 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.

  • Unresolved target vs incompatible value — clarified that an unknown column or a wildcard matching nothing fails with a verification error (even alongside ), while a resolved-but-type-incompatible column is skipped with a warning.

  • Per-query column limit — documented 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.

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:09 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,52 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    `*` targets only the query's own columns; it never targets metadata columns such as `_index` or `_score`, even when the data comes from an ordinary [`FROM`](/reference/query-languages/esql/commands/from.md). Name a metadata column explicitly to target it.

    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>

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:09 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,52 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    `*` targets only the query's own columns; it never targets metadata columns such as `_index` or `_score`, even when the data comes from an ordinary [`FROM`](/reference/query-languages/esql/commands/from.md). Name a metadata column explicitly to target it.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns. A column with no concrete type — for example one produced by `ROW a = null` — is treated as `null`-typed and is left unchanged even with an explicit value; cast it to a concrete type (for example `EVAL a = a::keyword`) before filling it.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Other types have no default and are left unchanged, with a warning. Some of them can still be filled with an explicit value even though they have no default: `datetime`, `date_nanos`, `ip`, and `version` accept a string. The rest — spatial types such as `geo_point`, ranges, histograms, counter fields, and `aggregate_metric_double` — cannot be filled at all, neither by `DEFAULT` nor by an explicit value.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`, and listing `*` together with a name or pattern still targets every column. A column that resolves but whose type the value does not fit is skipped with a warning rather than failing the query. A target that does not resolve is different: an unknown column name, or a wildcard pattern that matches no column, fails the query with a verification error, even when `*` is listed alongside it.

    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>

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:09 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,52 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    `*` targets only the query's own columns; it never targets metadata columns such as `_index` or `_score`, even when the data comes from an ordinary [`FROM`](/reference/query-languages/esql/commands/from.md). Name a metadata column explicitly to target it.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns. A column with no concrete type — for example one produced by `ROW a = null` — is treated as `null`-typed and is left unchanged even with an explicit value; cast it to a concrete type (for example `EVAL a = a::keyword`) before filling it.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Other types have no default and are left unchanged, with a warning. Some of them can still be filled with an explicit value even though they have no default: `datetime`, `date_nanos`, `ip`, and `version` accept a string. The rest — spatial types such as `geo_point`, ranges, histograms, counter fields, and `aggregate_metric_double` — cannot be filled at all, neither by `DEFAULT` nor by an explicit value.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`, and listing `*` together with a name or pattern still targets every column. A column that resolves but whose type the value does not fit is skipped with a warning rather than failing the query. A target that does not resolve is different: an unknown column name, or a wildcard pattern that matches no column, fails the query with a verification error, even when `*` is listed alongside it.
    +
    +When `ON *` runs after a union of sources, such as a multi-index or subquery [`FROM`](/reference/query-languages/esql/commands/from.md) or a [`FORK`](/reference/query-languages/esql/commands/fork.md), a metadata column such as `_index` that is null on some rows is left alone. Name it explicitly to fill it.
    +
    +All the `FILLNULL` commands in a query share a limit on how many columns they may fill (`esql.query.max_fillnull_fields`, 1,000 by default; each `FORK` branch and view reference that runs one counts toward it). A query that would exceed the limit is rejected rather than filling a subset, so with wide data prefer naming the columns you need, or narrow the input with [`KEEP`](/reference/query-languages/esql/commands/keep.md) or [`DROP`](/reference/query-languages/esql/commands/drop.md) before `FILLNULL ... ON *`.

    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>

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:09 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:09 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:09 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns.
    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:09 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Types that have no default, such as dates, `ip`, `version`, spatial types, ranges, histograms, counter fields, and `aggregate_metric_double`, are left unchanged, with a warning. To fill one of those, provide an explicit value instead.
    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:09 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Types that have no default, such as dates, `ip`, `version`, spatial types, ranges, histograms, counter fields, and `aggregate_metric_double`, are left unchanged, with a warning. To fill one of those, provide an explicit value instead.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`: a column whose type the value does not fit is skipped with a warning rather than failing the query. Listing `*` together with a name or pattern still targets every column.
    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:09 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,48 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged. This is mainly useful with a query parameter that might be null, so that a null parameter is an explicit no-op rather than an error.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Types that have no default, such as dates, `ip`, `version`, spatial types, ranges, histograms, counter fields, and `aggregate_metric_double`, are left unchanged, with a warning. To fill one of those, provide an explicit value instead.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`: a column whose type the value does not fit is skipped with a warning rather than failing the query. Listing `*` together with a name or pattern still targets every column.
    +
    +When `ON *` runs after a union of sources, such as a multi-index or subquery [`FROM`](/reference/query-languages/esql/commands/from.md) or a [`FORK`](/reference/query-languages/esql/commands/fork.md), a metadata column such as `_index` that is null on some rows is left alone. Name it explicitly to fill it.
    +
    +## Examples
    +
    +Replace the nulls in a single column with a value, leaving the rows that already have a value untouched:
    +
    +:::{include} ../../generated/x-pack-esql/commands/examples/fillnull.csv-spec/onColumnForDocs.md
    +:::
    +
    +Fill every column with the default for its type using `DEFAULT ON *`:
    edsavage edsavage commented on Nov 25, 2026 22:12 UTC
    Author

    Thanks — addressed the three follow-up Libra comments in ecd0c5900c40 (verified against the code first):

  • Metadata & patterns (line 26) — corrected to say the exclusion applies to *bare * only; a metadata column can be targeted by naming it or by a wildcard pattern that matches it (e.g. _ind for _index).

  • Unknown name vs 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).

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:14 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,52 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    A bare `*` targets only the query's own columns; it never targets metadata columns such as `_index` or `_score`, even when the data comes from an ordinary [`FROM`](/reference/query-languages/esql/commands/from.md). This exclusion applies only to bare `*`: to target a metadata column, name it, or use a wildcard pattern that matches it, such as `_ind*` for `_index`.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns. A column with no concrete type — for example one produced by `ROW a = null` — is treated as `null`-typed and is left unchanged even with an explicit value; cast it to a concrete type (for example `EVAL a = a::keyword`) before filling it.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Other types have no default and are left unchanged, with a warning. Some of them can still be filled with an explicit value even though they have no default: `datetime`, `date_nanos`, `ip`, and `version` accept a string. The rest — spatial types such as `geo_point`, ranges, histograms, counter fields, and `aggregate_metric_double` — cannot be filled at all, neither by `DEFAULT` nor by an explicit value.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`, and listing `*` together with a name or pattern still targets every column. A column that resolves but whose type the value does not fit is skipped with a warning rather than failing the query. A target that does not resolve is different: an unknown column name, or a wildcard pattern that matches no column, fails the query with a verification error, even when `*` is listed alongside it. This assumes the default handling of unmapped fields; if [`SET unmapped_fields`](/reference/query-languages/esql/esql-unmapped-fields.md) is set to `LOAD` or `LOAD_ALL`, a name that is absent from the mapping resolves as an unmapped column instead of failing, and `FILLNULL` can fill it.

    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>

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:14 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,52 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    `*` targets only the query's own columns; it never targets metadata columns such as `_index` or `_score`, even when the data comes from an ordinary [`FROM`](/reference/query-languages/esql/commands/from.md). Name a metadata column explicitly to target it.
    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:14 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,52 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    `*` targets only the query's own columns; it never targets metadata columns such as `_index` or `_score`, even when the data comes from an ordinary [`FROM`](/reference/query-languages/esql/commands/from.md). Name a metadata column explicitly to target it.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns. A column with no concrete type — for example one produced by `ROW a = null` — is treated as `null`-typed and is left unchanged even with an explicit value; cast it to a concrete type (for example `EVAL a = a::keyword`) before filling it.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Other types have no default and are left unchanged, with a warning. Some of them can still be filled with an explicit value even though they have no default: `datetime`, `date_nanos`, `ip`, and `version` accept a string. The rest — spatial types such as `geo_point`, ranges, histograms, counter fields, and `aggregate_metric_double` — cannot be filled at all, neither by `DEFAULT` nor by an explicit value.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`, and listing `*` together with a name or pattern still targets every column. A column that resolves but whose type the value does not fit is skipped with a warning rather than failing the query. A target that does not resolve is different: an unknown column name, or a wildcard pattern that matches no column, fails the query with a verification error, even when `*` is listed alongside it.
    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 25, 2026 22:14 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,52 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    `*` targets only the query's own columns; it never targets metadata columns such as `_index` or `_score`, even when the data comes from an ordinary [`FROM`](/reference/query-languages/esql/commands/from.md). Name a metadata column explicitly to target it.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns. A column with no concrete type — for example one produced by `ROW a = null` — is treated as `null`-typed and is left unchanged even with an explicit value; cast it to a concrete type (for example `EVAL a = a::keyword`) before filling it.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Other types have no default and are left unchanged, with a warning. Some of them can still be filled with an explicit value even though they have no default: `datetime`, `date_nanos`, `ip`, and `version` accept a string. The rest — spatial types such as `geo_point`, ranges, histograms, counter fields, and `aggregate_metric_double` — cannot be filled at all, neither by `DEFAULT` nor by an explicit value.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`, and listing `*` together with a name or pattern still targets every column. A column that resolves but whose type the value does not fit is skipped with a warning rather than failing the query. A target that does not resolve is different: an unknown column name, or a wildcard pattern that matches no column, fails the query with a verification error, even when `*` is listed alongside it.
    +
    +When `ON *` runs after a union of sources, such as a multi-index or subquery [`FROM`](/reference/query-languages/esql/commands/from.md) or a [`FORK`](/reference/query-languages/esql/commands/fork.md), a metadata column such as `_index` that is null on some rows is left alone. Name it explicitly to fill it.
    +
    +All the `FILLNULL` commands in a query share a limit on how many columns they may fill (`esql.query.max_fillnull_fields`, 1,000 by default; each `FORK` branch and view reference that runs one counts toward it). A query that would exceed the limit is rejected rather than filling a subset, so with wide data prefer naming the columns you need, or narrow the input with [`KEEP`](/reference/query-languages/esql/commands/keep.md) or [`DROP`](/reference/query-languages/esql/commands/drop.md) before `FILLNULL ... ON *`.
    edsavage edsavage commented on code on Nov 25, 2026 23:07 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,52 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    A bare `*` targets only the query's own columns; it never targets metadata columns such as `_index` or `_score`, even when the data comes from an ordinary [`FROM`](/reference/query-languages/esql/commands/from.md). This exclusion applies only to bare `*`: to target a metadata column, name it, or use a wildcard pattern that matches it, such as `_ind*` for `_index`.
    +
    +## Description
    +
    +The `FILLNULL` processing command replaces null values in the targeted columns with `fill_value`. Non-null values are never changed, and each column keeps its type; only its nulls are replaced.
    +
    +A literal `fill_value` is applied to every targeted column whose type it fits. A string is coerced where {{esql}} allows it, so a string value can fill `datetime`, `date_nanos`, `ip`, `version`, and `boolean` columns. If the value cannot be applied to a column, for example because its type does not match or it is out of range, that column is left unchanged and a warning lists the skipped columns. A column with no concrete type — for example one produced by `ROW a = null` — is treated as `null`-typed and is left unchanged even with an explicit value; cast it to a concrete type (for example `EVAL a = a::keyword`) before filling it.
    +
    +`DEFAULT` fills each targeted column with a default for its type: `0` for numeric types, an empty string for `keyword` and `text`, and `false` for `boolean`. Other types have no default and are left unchanged, with a warning. Some of them can still be filled with an explicit value even though they have no default: `datetime`, `date_nanos`, `ip`, and `version` accept a string. The rest — spatial types such as `geo_point`, ranges, histograms, counter fields, and `aggregate_metric_double` — cannot be filled at all, neither by `DEFAULT` nor by an explicit value.
    +
    +Targeting works the same for named columns, wildcard patterns, and `*`, and listing `*` together with a name or pattern still targets every column. A column that resolves but whose type the value does not fit is skipped with a warning rather than failing the query. A target that does not resolve is different: an unknown column name, or a wildcard pattern that matches no column, fails the query with a verification error, even when `*` is listed alongside it. This assumes the default handling of unmapped fields; if [`SET unmapped_fields`](/reference/query-languages/esql/esql-unmapped-fields.md) is set to `LOAD` or `LOAD_ALL`, a name that is absent from the mapping resolves as an unmapped column instead of failing, and `FILLNULL` can fill it.

    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.

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 27, 2026 00:43 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,50 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    A bare `*` targets only the query's own columns; it never targets a column whose name starts with an underscore, such as the metadata columns `_index` and `_score`, whatever the column holds and wherever it comes from. That includes a column that a union or a [`FORK`](/reference/query-languages/esql/commands/fork.md) passes on, and one that your own query makes with such a name. This exclusion applies only to bare `*`: to target such a column, name it, or use a wildcard pattern that matches it, such as `_ind*` for `_index`.

    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>

    edsavage edsavage commented on code on Nov 27, 2026 01:07 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,50 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    A bare `*` targets only the query's own columns; it never targets a column whose name starts with an underscore, such as the metadata columns `_index` and `_score`, whatever the column holds and wherever it comes from. That includes a column that a union or a [`FORK`](/reference/query-languages/esql/commands/fork.md) passes on, and one that your own query makes with such a name. This exclusion applies only to bare `*`: to target such a column, name it, or use a wildcard pattern that matches it, such as `_ind*` for `_index`.

    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.

    infra-vault-gh-plugin-prod[bot] infra-vault-gh-plugin-prod[bot] commented on code on Nov 27, 2026 01:07 UTC
    Code Review
    docs/reference/query-languages/esql/_snippets/commands/layout/fillnull.md:1
    @@ -0,0 +1,50 @@
    +```yaml {applies_to}
    +stack: ga 9.7+
    +serverless: ga
    +```
    +
    +The `FILLNULL` processing command replaces null values in one or more columns with a value you choose, or with a per-type default.
    +
    +## Syntax
    +
    +```esql
    +FILLNULL fill_value ON columns
    +```
    +
    +## Parameters
    +
    +`fill_value`
    +:   The value used to replace nulls. It can be one of:
    +
    +    - A literal number, string, or boolean (or a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to one).
    +    - `DEFAULT`, to fill each targeted column with a default for its type.
    +    - `NULL`, to leave nulls unchanged (an explicit no-op). Write the `NULL` keyword in the query itself: a [query parameter](/reference/query-languages/esql/esql-rest.md#esql-rest-params) that resolves to null is rejected with an error, so the keyword is how you request a no-op, for example when the fill value is only conditionally present.
    +
    +`columns`
    +:   A comma-separated list of column names and wildcard patterns to fill, for example `gender`, `a, b`, or `*_name`. Use `*` to target every column.
    +
    +    A bare `*` targets only the query's own columns; it never targets a column whose name starts with an underscore, such as the metadata columns `_index` and `_score`, whatever the column holds and wherever it comes from. That includes a column that a union or a [`FORK`](/reference/query-languages/esql/commands/fork.md) passes on, and one that your own query makes with such a name. This exclusion applies only to bare `*`: to target such a column, name it, or use a wildcard pattern that matches it, such as `_ind*` for `_index`.

    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>

    astefan astefan approved these changes on Nov 27, 2026 16:01 UTC
    Approved Reviewer

    LGTM

    edsavage edsavage commented on Dec 01, 2026 02:08 UTC
    Author

    Hi @kosabogi, could you take another look please?

    kosabogi kosabogi approved these changes on Dec 01, 2026 05:41 UTC
    Approved Reviewer

    LGTM, thank you!

    Reviewers
    Assignees
    edsavage edsavage
    Labels
    risk: low confidence: 92% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.0% (MEDIUM) · Higher = larger blast radius
    39.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 92% · Lower = rushed or shallow review
    92%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 3.1% · Safe to merge
    3.1%