-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Update metrics command #125193
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
Update metrics command #125193
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
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.
LGTM
| @Override | ||
| protected LogicalPlan rule(EsRelation r) { | ||
| if (r.indexMode() == IndexMode.TIME_SERIES) { | ||
| if (r.output().stream().anyMatch(a -> a.name().equals(MetadataAttribute.TSID_FIELD)) == false) { |
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.
Due to their perf caracteristics, we're looking to move away from the streams - use
Expressions.anyMatch(r.output(), a -> MetadataAttributes.TSID_FIELD.equals(a.name()) == false) instead.
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.
Sure, pushed 3453f98
| /** | ||
| * Uses the standard index mode if the special index mode is not required in the query. | ||
| */ | ||
| public final class DropIndexMode extends OptimizerRules.OptimizerRule<EsRelation> { |
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.
how about PruneUnusedIndexMode ?
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.
renamed in aa3a26c
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.
👍
| null | ||
| ); | ||
| return new Aggregate(source, relation, Aggregate.AggregateType.METRICS, stats.groupings, stats.aggregates); | ||
| return visitRelation(source(ctx), "METRICS", ctx.indexPatternAndMetadataFields()); |
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.
I hate to say this, but this may get renamed again (there's some confusion with the name "metrics"..). Still, I think the rest of this PR should hold and this should be a much smaller change (?)
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.
Yes, that's correct.
| EMPTY, | ||
| unresolvedTSRelation("foo"), | ||
| Aggregate.AggregateType.METRICS, | ||
| Aggregate.AggregateType.STANDARD, |
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.
For my education, don't we want to track all aggs right after METRICS as AggregateType.METRICS? In the sense that they're applied per-tsid by default?
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.
We are not using AggregateType now. We can adjust it later when we start using it.
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.
That was quick, thanks Nhat.
|
Thanks friends! |
This change updates the METRICS command syntax from METRICS index_pattern aggregations | ... to METRICS index_pattern | ..., removing inline aggregations. This PR does not filter out non-time-series indexes from the source; this will be addressed in a follow-up PR to keep this PR small.
This change updates the METRICS command syntax from METRICS index_pattern aggregations | ... to METRICS index_pattern | ..., removing inline aggregations. This PR does not filter out non-time-series indexes from the source; this will be addressed in a follow-up PR to keep this PR small.
This change updates the METRICS command syntax from
METRICS index_pattern aggregations | ...toMETRICS index_pattern | ..., removing inline aggregations. This PR does not filter out non-time-series indexes from the source; this will be addressed in a follow-up PR to keep this PR small.