elastic / elastic/roadmap

ES|QL name qualifiers to manage duplicated column names in a query

Open
#62 0 comments 0 reactions 1 assignee Assigned to @tylerperk View on GitHub
Component: Elasticsearch temp:removal-candidate
Dominant language
No language data
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Name qualifiers

Value Proposition

As ES|QL gains more ways to analyse and correlate multiple datasets in one query, like joins, views, and subqueries, there becomes a need to resolve or prevent field name conflicts and ambiguities. For example, a lookup index used with Lookup Join might have fields with the same names as fields in the source index of FROM. A subquery could return fields conflicting with field names in the surrounding query. Adjusting the schema of the datasets won't always be a good option - Users need to be able to handle these scenarios within the query. RENAME is sometimes an option but it can be cumbersome, especially when there are many fields involved.

Expected Outcomes

Users will be able to assign names (qualify) to the source indices, lookup indices etc within a query, and refer to those names elsewhere in that query to disambiguate columns. This is commonly available in databases as "aliasing" or name qualifiers. Users will be able to disambiguate between main fields and lookup fields in joins, avoid name conflicts, and queries written using qualifiers in FROM and LOOKUP JOIN will remain stable even in case of growing schemas.

An example query might look as follows (exact syntax TBD):
```
FROM main_idx AS main
| LOOKUP JOIN lu_idx AS lookup ON [main].[field] == [lookup].[field] AND [main].[field2] > [lookup].[other_field], ... | KEEP [lookup].[field]

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.