Class PromqlAttributesTranslationContext.SynthesizedAttributes
java.lang.Object
org.elasticsearch.xpack.esql.optimizer.rules.logical.promql.PromqlAttributesTranslationContext.SynthesizedAttributes
- Enclosing class:
PromqlAttributesTranslationContext
The synthesized attribute: the labels a subtree exposes, folded up the aggregate chain. A
SynthesizedAttributes is seeded at the leaf (PromqlAttributesTranslationContext.InheritedAttributes.reflect(), of(java.util.List<org.elasticsearch.xpack.esql.core.expression.Attribute>), none()) and
folded by each aggregate (foldIncluding(java.util.List<org.elasticsearch.xpack.esql.core.expression.Attribute>, org.elasticsearch.xpack.esql.optimizer.rules.logical.promql.PromqlAttributesTranslationContext.SynthesizedAttributes)/foldExcluding(java.util.List<org.elasticsearch.xpack.esql.core.expression.Attribute>, org.elasticsearch.xpack.esql.optimizer.rules.logical.promql.PromqlAttributesTranslationContext.SynthesizedAttributes)) until it is translated into a physical
PromqlAttributesTranslationContext.ResolvedAttributes.-
Method Summary
Modifier and TypeMethodDescriptiondeclared()The concrete labels this shape exposes - used to resolve an aggregate stacked directly on top of it.foldExcluding(List<Attribute> removed, PromqlAttributesTranslationContext.SynthesizedAttributes child) FoldWITHOUT(E)over the child shape: drop the excluded labels (child.G \ E) and accumulate the exclusions (child.X | E).foldIncluding(List<Attribute> promised, PromqlAttributesTranslationContext.SynthesizedAttributes child) FoldBY(W)over the child shape: keep theBYkeys the child actually exposes (child.G & W), but remember the fullWsotranslate(java.util.List<org.elasticsearch.xpack.esql.core.expression.Attribute>)can null-fill any that are missing.booleanWhether this shape exposes any concrete label that an outer binary operator could match on.booleanWhether this subtree contains aWITHOUT, i.e.none()The shape of a subtree that exposes no specific grouping (a literal selector, a scalar, a bareNONEaggregate).A shape built directly from a known label set, e.g., a bare selector's output.Translate an aggregate stacked on top of another aggregate, binding it to the child plan's resolvedchildColumns(runtime data, available only once the child has been translated).translateLeaf(List<Attribute> pathExclusions) Translate the innermost aggregate, whose child is the raw selector and which therefore owns the single physical_timeseriesgrouping.
-
Method Details
-
none
The shape of a subtree that exposes no specific grouping (a literal selector, a scalar, a bareNONEaggregate). It carries theSCALARsentinel: top-like for set operations (so aBYstacked directly on top keeps its declared keys) but, unlikeT, it does not materialise a_timeseriesgrouping. -
of
A shape built directly from a known label set, e.g., a bare selector's output. -
foldIncluding
public static PromqlAttributesTranslationContext.SynthesizedAttributes foldIncluding(List<Attribute> promised, PromqlAttributesTranslationContext.SynthesizedAttributes child) FoldBY(W)over the child shape: keep theBYkeys the child actually exposes (child.G & W), but remember the fullWsotranslate(java.util.List<org.elasticsearch.xpack.esql.core.expression.Attribute>)can null-fill any that are missing. ABYclears exclusions because it groups by concrete labels. -
foldExcluding
public static PromqlAttributesTranslationContext.SynthesizedAttributes foldExcluding(List<Attribute> removed, PromqlAttributesTranslationContext.SynthesizedAttributes child) FoldWITHOUT(E)over the child shape: drop the excluded labels (child.G \ E) and accumulate the exclusions (child.X | E). -
translateLeaf
public PromqlAttributesTranslationContext.ResolvedAttributes translateLeaf(List<Attribute> pathExclusions) Translate the innermost aggregate, whose child is the raw selector and which therefore owns the single physical_timeseriesgrouping. Labels resolve against this shape's owngrouping; the dimensions to exclude are the full path exclusions supplied by the matchingPromqlAttributesTranslationContext.InheritedAttributes.pathExclusions(). -
translate
public PromqlAttributesTranslationContext.ResolvedAttributes translate(List<Attribute> childColumns) Translate an aggregate stacked on top of another aggregate, binding it to the child plan's resolvedchildColumns(runtime data, available only once the child has been translated). Labels resolve against those columns; an empty list means "trust this shape as-is". -
declared
The concrete labels this shape exposes - used to resolve an aggregate stacked directly on top of it. -
hasDeclared
public boolean hasDeclared()Whether this shape exposes any concrete label that an outer binary operator could match on. -
hasExclusions
public boolean hasExclusions()Whether this subtree contains aWITHOUT, i.e. its_timeserieshides dimensions to pack around.
-