Class InvalidMappedField
java.lang.Object
org.elasticsearch.xpack.esql.core.type.EsField
org.elasticsearch.xpack.esql.core.type.InvalidMappedField
- All Implemented Interfaces:
Writeable
Representation of field mapped differently across indices; or being potentially unmapped in some, in which case it is treated as
DataType.KEYWORD in the indices where it is unmapped.
Used during mapping discovery only.
Note that the fields typesToIndices and isPotentiallyUnmapped are not serialized because that information is
not required through the cluster, only surviving as long as the Analyser phase of query planning.
It is used specifically for the 'union types' and 'unmapped fields' feature in ES|QL.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.type.EsField
EsField.Exact, EsField.TimeSeriesFieldTypeNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the path to the keyword version of this field if this field is text and it has a subfield that is indexed as keyword, throws an exception if such field is not found or the field name itself in all other cases.Returns andEsField.Exactobject with all the necessary info about the field: If it has an exact underlying field or not and if not an error message why it doesn'tgetWriteableName(TransportVersion transportVersion) This needs to be overridden by subclasses for specific serializationinthashCode()booleanstatic InvalidMappedFieldAnInvalidMappedFieldis potentially unmapped if at least one index does not contain a mapping for the field, and the user requested we load the values from_source.types()voidwriteContent(StreamOutput out) This needs to be overridden by subclasses for specific serializationMethods inherited from class org.elasticsearch.xpack.esql.core.type.EsField
getDataType, getName, getNodeStringName, getProperties, getReader, getTimeSeriesFieldType, isAggregatable, isAlias, readFrom, readTimeSeriesFieldType, toString, writeTimeSeriesFieldType, writeTo
-
Constructor Details
-
InvalidMappedField
-
InvalidMappedField
-
InvalidMappedField
-
InvalidMappedField
- Throws:
IOException
-
-
Method Details
-
potentiallyUnmapped
public static InvalidMappedField potentiallyUnmapped(String name, Map<String, Set<String>> typesToIndices) AnInvalidMappedFieldis potentially unmapped if at least one index does not contain a mapping for the field, and the user requested we load the values from_source. In that case, there is (possibly) an additional type conflict since we treat unmapped fields asDataType.KEYWORD. -
types
-
writeContent
Description copied from class:EsFieldThis needs to be overridden by subclasses for specific serialization- Overrides:
writeContentin classEsField- Throws:
IOException
-
getWriteableName
Description copied from class:EsFieldThis needs to be overridden by subclasses for specific serialization- Overrides:
getWriteableNamein classEsField
-
errorMessage
-
hashCode
public int hashCode() -
equals
-
getExactField
Description copied from class:EsFieldReturns the path to the keyword version of this field if this field is text and it has a subfield that is indexed as keyword, throws an exception if such field is not found or the field name itself in all other cases. To avoid the exceptionEsField.getExactInfo()should be used beforehand, to check if an exact field exists and if not get the errorMessage which explains why is that.- Overrides:
getExactFieldin classEsField
-
getExactInfo
Description copied from class:EsFieldReturns andEsField.Exactobject with all the necessary info about the field:- If it has an exact underlying field or not
- and if not an error message why it doesn't
- Overrides:
getExactInfoin classEsField
-
getTypesToIndices
-
isPotentiallyUnmapped
public boolean isPotentiallyUnmapped()
-