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.
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
If
some_fieldis missing, we know we need to try and load it fromidx. Trying to load it fromlu-idxwould be wrong.For
other_field, it's less clear as it could have originated from bothidxandlu-idx.The current implementation tries to load
other_fieldfromidx. 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 loadother_fieldfromlu-idx, we cannot also load it fromidxas theother_fieldfromlu-idxwill just shadow that field.