Skip to content

ESQL: unmapped_fields="load" with LOOKUP JOIN #142026

@alex-spies

Description

@alex-spies

Relates #138888

Figure out the semantics for LOOKUP JOIN in case of a completely unmapped field. Due to how LOOKUP JOIN handles name conflicts, we cannot assume that a missing field is coming from a lookup index if we also assume it comes from a FROM command; we have to choose one.

We should add spec + analyzer unmapped tests to demonstrate the semantics we landed on.

Example: Consider the simple query

SET unmapped_fields="load";
FROM idx | RENAME some_field AS match_field | LOOKUP JOIN lu-idx ON match_field | KEEP match_field, other_field

If some_field is missing, we know we need to try and load it from idx. Trying to load it from lu-idx would be wrong.

For other_field, it's less clear as it could have originated from both idx and lu-idx.

The current implementation tries to load other_field from idx. This sounds reasonable, but if we ever change our minds, we cannot change the behavior here without breaking bwc (unless we implement qualifiers): If we try to load other_field from lu-idx, we cannot also load it from idx as the other_field from lu-idx will just shadow that field.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions