Class AttributeMap<E>

java.lang.Object
org.elasticsearch.xpack.esql.core.expression.AttributeMap<E>
All Implemented Interfaces:
Map<Attribute,E>

public final class AttributeMap<E> extends Object implements Map<Attribute,E>
Dedicated map for checking Attribute equality. This is typically the case when comparing the initial declaration of an Attribute, such as FieldAttribute with references to it, namely ReferenceAttribute. Using plain object equality, the two references are difference due to their type however semantically, they are the same. Expressions support semantic equality through Expression.semanticEquals(Expression) - this map is dedicated solution for attributes as its common case picked up by the plan rules.

The map implementation is mutable thus consumers need to be careful NOT to modify the content unless they have ownership. Worth noting the combine(AttributeMap), intersect(AttributeMap) and subtract(AttributeMap) methods which return copies, decoupled from the input maps. In other words the returned maps can be modified without affecting the input or vice-versa.