Class Attribute
java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<Expression>
org.elasticsearch.xpack.esql.core.expression.Expression
org.elasticsearch.xpack.esql.core.expression.NamedExpression
org.elasticsearch.xpack.esql.core.expression.Attribute
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable
- Direct Known Subclasses:
EmptyAttribute,TypedAttribute,UnresolvedAttribute
Expressions that can be materialized and describe properties of the derived table.
In other words, an attribute represent a column in the results of a query.
In the statement SELECT ABS(foo), A, B+C FROM ... the three named
expressions ABS(foo), A, B+C get converted to attributes and the user can
only see Attributes.
In the statement SELECT foo FROM TABLE WHERE foo > 10 + 1 only foo inside the SELECT
is a named expression (an Alias will be created automatically for it).
The rest are not as they are not part of the projection and thus are not part of the derived table.-
Nested Class Summary
Nested 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
FieldsModifier and TypeFieldDescriptionprotected static final StringChanging this will break bwc with 8.15, seeFieldAttribute.fieldName(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Expressionprotected abstract Attributeclone(Source source, String name, DataType type, Nullability nullability, NameId id, boolean synthetic) booleaninthashCode()protected abstract Stringlabel()nullable()static StringrawTemporaryName(String... parts) final ExpressionreplaceChildren(List<Expression> newChildren) booleansemanticEquals(Expression other) inttoString()withDataType(DataType type) withLocation(Source source) withNullability(Nullability nullability) Methods inherited from class org.elasticsearch.xpack.esql.core.expression.NamedExpression
id, name, syntheticMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, childrenResolved, dataType, fold, foldable, propertiesToString, resolved, resolveType, typeResolvedMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
anyMatch, children, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, info, nodeName, nodeProperties, replaceChildrenSameSize, source, sourceLocation, sourceText, transformChildren, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUpMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
-
Field Details
-
SYNTHETIC_ATTRIBUTE_NAME_PREFIX
Changing this will break bwc with 8.15, seeFieldAttribute.fieldName().- See Also:
-
-
Constructor Details
-
Attribute
-
Attribute
-
Attribute
public Attribute(Source source, String name, Nullability nullability, @Nullable NameId id, boolean synthetic)
-
-
Method Details
-
rawTemporaryName
-
replaceChildren
- Specified by:
replaceChildrenin classNode<Expression>
-
nullable
- Specified by:
nullablein classExpression
-
references
- Overrides:
referencesin classExpression
-
withLocation
-
withName
-
withNullability
-
withId
-
withDataType
-
clone
-
toAttribute
Description copied from class:NamedExpressionTry to return eitherthisif it is anAttribute, or aReferenceAttributeto it otherwise. Return anUnresolvedAttributeif this is unresolved.- Specified by:
toAttributein classNamedExpression
-
semanticHash
public int semanticHash()- Overrides:
semanticHashin classExpression
-
semanticEquals
- Overrides:
semanticEqualsin classExpression
-
canonicalize
- Overrides:
canonicalizein classExpression
-
hashCode
public int hashCode()- Overrides:
hashCodein classNamedExpression
-
equals
- Overrides:
equalsin classNamedExpression
-
toString
- Overrides:
toStringin classNamedExpression
-
nodeString
- Overrides:
nodeStringin classNamedExpression
-
label
-