Skip to content

[Issue]: Apr 15th v9.0 LOOKUP JOIN documentation example makes no sense #1155

Closed
@jackkulp

Description

@jackkulp

Type of issue

Inaccurate

What documentation page is affected

https://www.elastic.co/docs/reference/query-languages/esql/esql-lookup-join

What happened?

FROM employees
| EVAL language_code = emp_no % 10
| LOOKUP JOIN languages_lookup_non_unique_key ON language_code
| WHERE emp_no > 10090 AND emp_no < 10096
| SORT emp_no, country
| KEEP emp_no, language_code, language_name, country;

The example ESQL here makes no sense, based on the given tables on the doc.

  • The index shown on the page is named "languages_non_unique_key", so the lookup index in the code is wrong.
  • The EVAL makes no sense as it's taking the last digit of the employee number and relating that to the language_code from the lookup index??? instead of using/matching on the employees index's existing language field??

Shouldn't it be:

FROM employees
| EVAL language_code = language
| LOOKUP JOIN languages_non_unique_key ON language_code
<suggested extra options that make more sense:>
| WHERE emp_no > 10090 AND emp_no <10096
| SORT emp_no
| KEEP emp_no, first_name, language_name

optionally keep the country info in there,
But given the raw info, it seemed like the point of this example was to show the Language Name / Countries alongside the employee's information

Additional info

No response

Metadata

Metadata

Assignees

Labels

Team:PlatformIssues owned by the Platform Docs Teamsource:webIssues originating from the elastic.co docs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions