-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ES|QL: Refactor FUSE planning #134038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
ES|QL: Refactor FUSE planning #134038
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
99d9210
Refactor FUSE planning
ioanatia 578be9e
Update usage test
ioanatia 6ef266d
Fix typo in capability name and counter
ioanatia 50f0ab0
Remove dedup_counter
ioanatia 527953d
Update 60_usage yet again after failure
ioanatia 71adaa6
Merge branch 'main' into rename_rrf_plans_to_fuse
ioanatia f729736
Bump non_snapshot_test_for_telemetry and snapshot_test_for_telemetry …
ioanatia 9a0edf5
Merge remote-tracking branch 'elasticsearch/main' into rename_rrf_pla…
ioanatia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 0 additions & 111 deletions
111
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Dedup.java
This file was deleted.
Oops, something went wrong.
90 changes: 90 additions & 0 deletions
90
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/fuse/Fuse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.esql.plan.logical.fuse; | ||
|
||
import org.elasticsearch.common.io.stream.StreamOutput; | ||
import org.elasticsearch.xpack.esql.capabilities.TelemetryAware; | ||
import org.elasticsearch.xpack.esql.core.expression.Attribute; | ||
import org.elasticsearch.xpack.esql.core.expression.Expression; | ||
import org.elasticsearch.xpack.esql.core.expression.NamedExpression; | ||
import org.elasticsearch.xpack.esql.core.tree.NodeInfo; | ||
import org.elasticsearch.xpack.esql.core.tree.Source; | ||
import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan; | ||
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
public class Fuse extends UnaryPlan implements TelemetryAware { | ||
private final Attribute score; | ||
private final Attribute discriminator; | ||
private final List<NamedExpression> groupings; | ||
private final FuseType fuseType; | ||
|
||
public enum FuseType { | ||
RRF, | ||
LINEAR | ||
}; | ||
|
||
public Fuse( | ||
Source source, | ||
LogicalPlan child, | ||
Attribute score, | ||
Attribute discriminator, | ||
List<NamedExpression> groupings, | ||
FuseType fuseType | ||
) { | ||
super(source, child); | ||
this.score = score; | ||
this.discriminator = discriminator; | ||
this.groupings = groupings; | ||
this.fuseType = fuseType; | ||
|
||
} | ||
|
||
@Override | ||
public String getWriteableName() { | ||
throw new UnsupportedOperationException("not serialized"); | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
throw new UnsupportedOperationException("not serialized"); | ||
} | ||
|
||
@Override | ||
protected NodeInfo<? extends LogicalPlan> info() { | ||
return NodeInfo.create(this, Fuse::new, child(), score, discriminator, groupings, fuseType); | ||
} | ||
|
||
@Override | ||
public UnaryPlan replaceChild(LogicalPlan newChild) { | ||
return new Fuse(source(), newChild, score, discriminator, groupings, fuseType); | ||
} | ||
|
||
public List<NamedExpression> groupings() { | ||
return groupings; | ||
} | ||
|
||
public Attribute discriminator() { | ||
return discriminator; | ||
} | ||
|
||
public Attribute score() { | ||
return score; | ||
} | ||
|
||
public FuseType fuseType() { | ||
return fuseType; | ||
} | ||
|
||
@Override | ||
public boolean expressionsResolved() { | ||
return score.resolved() && discriminator.resolved() && groupings.stream().allMatch(Expression::resolved); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically only RRF is used for now - but we will add linear combination support soon after this PR