Class UnresolvedAttribute
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable,Unresolvable
- Direct Known Subclasses:
UnresolvedTimestamp
Attribute subclasses
during analysis. Aliases whose types are not yet resolved also return UnresolvedAttributes when calling
Alias.toAttribute().
Note that the NamedExpression.id() is respected in NamedExpression.equals(Object). Two unresolved attributes with the same name but different
NameId can occur e.g. when resolving EVAL x = 2*x, y = 3*x. In the first expression, x is referring to an
upstream attribute, while in the second expression it is referring to the alias defined in the first expression. This allows us to
distinguish the attributes generated by the EVAL from attributes referenced by it.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Attribute
Attribute.IdIgnoringWrapperNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolutionNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.xpack.esql.core.expression.Attribute
SYNTHETIC_ATTRIBUTE_NAME_PREFIXFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_WIDTHFields inherited from interface org.elasticsearch.xpack.esql.core.capabilities.Unresolvable
UNRESOLVED_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionUnresolvedAttribute(Source source, String name) UnresolvedAttribute(Source source, String name, String unresolvedMessage) UnresolvedAttribute(Source source, String qualifier, String name, String unresolvedMessage) UnresolvedAttribute(Source source, String qualifier, String name, NameId id, String unresolvedMessage, Object resolutionMetadata) UnresolvedAttribute(Source source, String name, NameId id, String unresolvedMessage, Object resolutionMetadata) -
Method Summary
Modifier and TypeMethodDescriptionprotected Attributeclone(Source source, String qualifier, String name, DataType dataType, Nullability nullability, NameId id, boolean synthetic) booleandataType()TheDataTypereturned by executing the tree rooted at this expression.static StringerrorMessage(String name, List<String> potentialMatches) protected NodeInfo<? extends UnresolvedAttribute> info()Normally, you want to use one of the staticcreatemethods to implement this.protected booleaninnerEquals(Object o, boolean ignoreIds) The actual equality check, after shortcuttingthis == oand class checks.protected intinnerHashCode(boolean ignoreIds) booleanbooleanisMetric()protected Stringlabel()booleanresolved()protected Expression.TypeResolutionThe implementation ofExpression.typeResolved(), which is just a caching wrapper around this method.toString()NOTE: Any non-null return value from this method indicates that the item in question could not be resolved.withUnresolvedMessage(String unresolvedMessage) voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.core.expression.Attribute
canonicalize, checkAndSerializeQualifier, dataTypeEquals, ignoreId, nullable, qualifiedName, qualifier, rawTemporaryName, readQualifier, references, replaceChildren, semanticEquals, semanticHash, toAttribute, withDataType, withLocation, withName, withNullability, withQualifierMethods inherited from class org.elasticsearch.xpack.esql.core.expression.NamedExpression
equals, equals, hashCode, hashCode, id, name, syntheticMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, childrenResolved, fold, foldable, propertiesToString, typeResolvedMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
anyMatch, children, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, replaceChildrenSameSize, source, sourceLocation, sourceText, transformChildren, transformDown, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUp
-
Field Details
-
unresolvedMsg
-
resolutionMetadata
-
-
Constructor Details
-
UnresolvedAttribute
-
UnresolvedAttribute
-
UnresolvedAttribute
-
UnresolvedAttribute
-
UnresolvedAttribute
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
info
Description copied from class:NodeNormally, you want to use one of the staticcreatemethods to implement this.For
QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations likeQueryPlan#transformExpressionsOnly(Function)will not have an effect.- Specified by:
infoin classNode<Expression>
-
resolutionMetadata
-
customMessage
public boolean customMessage() -
resolved
public boolean resolved()- Specified by:
resolvedin interfaceResolvable- Specified by:
resolvedin interfaceUnresolvable- Overrides:
resolvedin classExpression
-
clone
-
withId
-
withUnresolvedMessage
-
resolveType
Description copied from class:ExpressionThe implementation ofExpression.typeResolved(), which is just a caching wrapper around this method. See it's javadoc for what this method should return.Implementations will rarely interact with the
Expression.TypeResolutionclass directly, instead usually calling the utility methods onTypeResolutions.Implementations should fail if
Expression.childrenResolved()returnsfalse.- Overrides:
resolveTypein classExpression
-
dataType
Description copied from class:ExpressionTheDataTypereturned by executing the tree rooted at this expression. IfExpression.typeResolved()returns an error then the behavior of this method is undefined. It may return a valid type. Or it may throw an exception. Or it may return a totally nonsensical type.- Specified by:
dataTypein classExpression
-
toString
-
label
-
isDimension
public boolean isDimension()- Specified by:
isDimensionin classAttribute- Returns:
- true if the attribute represents a TSDB dimension type
-
isMetric
public boolean isMetric() -
nodeString
- Overrides:
nodeStringin classAttribute
-
unresolvedMessage
Description copied from interface:UnresolvableNOTE: Any non-null return value from this method indicates that the item in question could not be resolved.- Specified by:
unresolvedMessagein interfaceUnresolvable
-
errorMessage
-
innerHashCode
protected int innerHashCode(boolean ignoreIds) - Overrides:
innerHashCodein classAttribute
-
innerEquals
Description copied from class:NamedExpressionThe actual equality check, after shortcuttingthis == oand class checks.- Overrides:
innerEqualsin classAttribute
-