Class FieldAttribute
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
org.elasticsearch.xpack.esql.core.expression.TypedAttribute
org.elasticsearch.xpack.esql.core.expression.FieldAttribute
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable
Attribute for an ES field.
This class offers:
- name - the name of the attribute, but not necessarily of the field.
- The raw EsField representing the field; for parent.child.grandchild this is just grandchild.
- parentName - the full path to the immediate parent of the field, e.g. parent.child (without .grandchild)
To adequately represent e.g. union types, the name of the attribute can be altered because we may have multiple synthetic field
attributes that really belong to the same underlying field. For instance, if a multi-typed field is used both as
field::string
and field::ip, we'll generate 2 field attributes called $$field$converted_to$keyword and $$field$converted_to$ip
which still refer to the same underlying index field.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA field name, as found in the mapping.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
FieldsFields inherited from class org.elasticsearch.xpack.esql.core.expression.Attribute
SYNTHETIC_ATTRIBUTE_NAME_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionFieldAttribute(Source source, String parentName, String name, EsField field) FieldAttribute(Source source, String parentName, String name, EsField field, boolean synthetic) FieldAttribute(Source source, String parentName, String name, EsField field, Nullability nullability, NameId id, boolean synthetic) FieldAttribute(Source source, String name, EsField field) -
Method Summary
Modifier and TypeMethodDescriptionprotected Attributeclone(Source source, String name, DataType type, Nullability nullability, NameId id, boolean synthetic) booleanfield()The full name of the field in the index, including all parent fields.inthashCode()protected NodeInfo<FieldAttribute> info()Return the information about this node.protected Stringlabel()name()The name of the attribute.static FieldAttributereadFrom(StreamInput in) withDataType(DataType type) voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.core.expression.TypedAttribute
dataTypeMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Attribute
canonicalize, nodeString, nullable, rawTemporaryName, references, replaceChildren, semanticEquals, semanticHash, toAttribute, toString, withId, withLocation, withName, withNullabilityMethods inherited from class org.elasticsearch.xpack.esql.core.expression.NamedExpression
id, syntheticMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, childrenResolved, 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, nodeName, nodeProperties, replaceChildrenSameSize, source, sourceLocation, sourceText, transformChildren, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp
-
Field Details
-
lazyFieldName
-
-
Constructor Details
-
FieldAttribute
-
FieldAttribute
-
FieldAttribute
-
FieldAttribute
-
-
Method Details
-
writeTo
- Throws:
IOException
-
readFrom
- Throws:
IOException
-
getWriteableName
-
info
Description copied from class:NodeReturn the information about this node.Normally, you want to use one of the static
createmethods 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 of 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>
-
parentName
-
fieldName
The full name of the field in the index, including all parent fields. E.g.parent.subfield.this_field. -
name
The name of the attribute. Can deviate from the field name e.g. in case of union types. For the physical field name, usefieldName().- Overrides:
namein classNamedExpression
-
getExactInfo
-
exactAttribute
-
clone
-
withDataType
- Overrides:
withDataTypein classAttribute
-
hashCode
public int hashCode()- Overrides:
hashCodein classTypedAttribute
-
equals
- Overrides:
equalsin classTypedAttribute
-
label
-
field
-