Conversation
| physicalChildren.add(mappedChild); | ||
| } | ||
| return new MergeExec(merge.source(), physicalChildren, merge.output()); | ||
| return new MergeExec(fork.source(), physicalChildren, fork.output()); |
There was a problem hiding this comment.
I have kept the name MergeExec because from an execution standpoint we are merging results from multiple sub plans.
When we add support for multiple forks (fork after fork) - we would likely need a ForkExec too.
There was a problem hiding this comment.
that make sense to me. ++
| plan.forEachUp(UnresolvedRelation.class, p -> { | ||
| List<TableInfo> list = p.indexMode() == IndexMode.LOOKUP ? lookupIndices : indices; | ||
| list.add(new TableInfo(p.indexPattern())); | ||
| Collection<TableInfo> collection = p.indexMode() == IndexMode.LOOKUP ? lookupIndices : indices; |
There was a problem hiding this comment.
I needed to make this change and the ones in TableInfo because otherwise queries using FORK would fail with the following errror:
Note that this only ensures that we collect distinct values for indices, not lookupIndices, meaning there should be no effect on the lookup join functionality.
There was a problem hiding this comment.
This makes sense to. I don't remember exactly, but I did run into this in the past but then didn't need it for a separate reason.
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
ChrisHegarty
left a comment
There was a problem hiding this comment.
This is a good change and addresses a number of follow-up tasks that arose during the initial FORK implementation. LGTM
| } | ||
| } | ||
|
|
||
| private static class ImplicitForkCasting extends ParameterizedRule<LogicalPlan, LogicalPlan, AnalyzerContext> { |
There was a problem hiding this comment.
Thanks for removing these XXForkXX rules, I was hoping that we could be get to this point when I added them originally.
| plan.forEachUp(UnresolvedRelation.class, p -> { | ||
| List<TableInfo> list = p.indexMode() == IndexMode.LOOKUP ? lookupIndices : indices; | ||
| list.add(new TableInfo(p.indexPattern())); | ||
| Collection<TableInfo> collection = p.indexMode() == IndexMode.LOOKUP ? lookupIndices : indices; |
There was a problem hiding this comment.
This makes sense to. I don't remember exactly, but I did run into this in the past but then didn't need it for a separate reason.
| physicalChildren.add(mappedChild); | ||
| } | ||
| return new MergeExec(merge.source(), physicalChildren, merge.output()); | ||
| return new MergeExec(fork.source(), physicalChildren, fork.output()); |
There was a problem hiding this comment.
that make sense to me. ++
|
Apologize for the late comment, as fork is still under snapshot, it is fine to address some potential issues as follow ups. We will need to be aware of the limitations of full text functions when generating the children of forks, here is an example Not all of the commands are allowed to be before full text function, that's how we come across this issue, do we want to push fork before the limit or just error out? |
|
We should just error out in this case. I think the current behaviour is the one we should expect. |
One piece of feedback we got from #121948 was that
Forkis not a Nary plan which further complicates the implementation with special treatment ofForkin the analyzer/optimizer/verifier.We change the planning of
Forkby making it N-ary, while also solving some of the outstanding issues:elasticsearch/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlSession.java
Lines 602 to 604 in 0d64aab
for semantic search, we require rewriting the query builder for the match function on the coordinator. Initially we added special handling of
ForkinQueryBuilderResolver. This is now removed since it is no longer necessary. The functionality is tested through csv tests and continues to work.we remove most of the special handling in the analyzer for
Fork- what remains is stillAddImplicitForkLimitwhich is needed to add the default limit for each sub plan.we remove the special handling of
Forkin the verifier - this will help when we want to add support for allowing more than just where/limit/sort in the Fork branches. Without this change we would need to add more special handling ofForkto do proper validation.