Class EmptyAttribute
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable
-
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
Fields 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_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Attributeclone(Source source, String qualifier, String name, DataType type, Nullability nullability, NameId id, boolean synthetic) dataType()TheDataTypereturned by executing the tree rooted at this expression.protected NodeInfo<? extends Expression> 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()booleansemanticEquals(Expression other) Whether this expression means the same asother, even if they are not exactly equal.intA hash code that is consistent withExpression.semanticEquals(org.elasticsearch.xpack.esql.core.expression.Expression).voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.core.expression.Attribute
canonicalize, checkAndSerializeQualifier, dataTypeEquals, ignoreId, nodeString, nullable, qualifiedName, qualifier, rawTemporaryName, readQualifier, references, replaceChildren, toAttribute, toString, withDataType, withId, 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, resolveType, 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
-
Constructor Details
-
EmptyAttribute
-
-
Method Details
-
writeTo
- Throws:
IOException
-
getWriteableName
-
clone
-
label
-
isDimension
public boolean isDimension()- Specified by:
isDimensionin classAttribute- Returns:
- true if the attribute represents a TSDB dimension type
-
isMetric
public boolean isMetric() -
resolved
public boolean resolved()- Specified by:
resolvedin interfaceResolvable- Overrides:
resolvedin 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
-
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>
-
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
-
semanticHash
public int semanticHash()Description copied from class:ExpressionA hash code that is consistent withExpression.semanticEquals(org.elasticsearch.xpack.esql.core.expression.Expression).- Overrides:
semanticHashin classAttribute
-
semanticEquals
Description copied from class:ExpressionWhether this expression means the same asother, even if they are not exactly equal. For example,a + bandb + aare not equal, but they are semantically equal.If two expressions are equal, they are also semantically equal, but the reverse is generally not true.
Caution!
Attribute.semanticEquals(Expression)is especially lenient, as it considers two attributes with the sameNameIdto be semantically equal, even if they have different data types or are represented using different classes.But this doesn't extend to expressions containing attributes as children, which is pretty inconsistent. We have to revisit this before using
Expression.semanticEquals(org.elasticsearch.xpack.esql.core.expression.Expression)in more places.- Overrides:
semanticEqualsin classAttribute
-