
Filing this issue to track a question/comment that was raised by @ywangd  here https://github.com/elastic/elasticsearch/pull/98309#discussion_r1294115440

One question I do have is why we chose to [execute the LookupRequest with the enrich origin](https://github.com/elastic/elasticsearch/blob/2e4440ff1c0decf79f8a40688566411f7d518aa7/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/EnrichLookupService.java#L141C2-L141C2). It means the following query works when the user has access to only the playlist index without access to either the songs enrich policy or its associated index.

```
FROM playlist | ENRICH songs ON song_id
```

It feels a bit weird to me that we have no control on who can use what enrich process. That said, we don't have a good story around enrich and ingest pipeline either, i.e. we have no control over who can use what pipeline where a pipeline can contain an enrich processor. There have been quite a few complaints from users and we have an https://github.com/elastic/elasticsearch/issues/57586 for it. I wonder whether we should not repeat the problem here with ES|QL. On the surface, it might be easier to tackle compared to ingest pipelines since ES|QL is read-only and has no "bulk" operations. What do you think?
x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/expression/AttributeMapTests.java
Attribute one = a("one");
        Attribute two = fieldAttribute("two", DataTypes.INTEGER);
        Attribute three = fieldAttribute("three", DataTypes.INTEGER);
        Alias threeAlias = new Alias(Source.EMPTY, "three_alias", three);
        Alias threeAliasAlias = new Alias(Source.EMPTY, "three_alias_alias", threeAlias);
        builder.put(one, of("one"));
        builder.put(two, "two");
        builder.put(three, of("three"));
        builder.put(threeAlias.toAttribute(), threeAlias.child());
        builder.put(threeAliasAlias.toAttribute(), threeAliasAlias.child());
        AttributeMap<Object> map = builder.build();
        assertEquals(of("one"), map.resolve(one));
        assertEquals("two", map.resolve(two));
        assertEquals(of("three"), map.resolve(three));
        assertEquals(of("three"), map.resolve(threeAlias));
        assertEquals(of("three"), map.resolve(threeAliasAlias));
        assertEquals(of("three"), map.resolve(threeAliasAlias, threeAlias));
        Attribute four = a("four");
        assertEquals("not found", map.resolve(four, "not found"));
        assertNull(map.resolve(four));
        assertEquals(four, map.resolve(four, four));
    }
    public void testResolveOneHopCycle() {
        AttributeMap.Builder<Object> builder = AttributeMap.builder();
        Attribute a = fieldAttribute("a", DataTypes.INTEGER);
        Attribute b = fieldAttribute("b", DataTypes.INTEGER);
        builder.put(a, a);
        builder.put(b, a);
        AttributeMap<Object> map = builder.build();
        assertEquals(a, map.resolve(a, "default"));