Class PotentiallyUnmappedSingleTypeEsField
java.lang.Object
org.elasticsearch.xpack.esql.core.type.EsField
org.elasticsearch.xpack.esql.core.type.TypeConflictedField
org.elasticsearch.xpack.esql.core.type.PotentiallyUnmappedSingleTypeEsField
- All Implemented Interfaces:
Writeable
A variant of
PotentiallyUnmappedKeywordEsField that is mapped to exactly one, non-keyword type where it is mapped, and unmapped
in other indices. Its EsField.getDataType() is that mapped type (widened for small numerics), because reporting
DataType.UNSUPPORTED (as a bare TypeConflictedField does) breaks renames and groupings that read the type before this
field is resolved. It retains the original, unwidened mapped EsField (with its properties) to fall back to.
If an implicit cast from DataType.KEYWORD to the mapped type exists, it is auto-cast to that type. Otherwise it behaves exactly
as without UNMAPPED_FIELDS="LOAD" (mapped type where mapped, null where unmapped), unless an explicit cast accepting
KEYWORD is applied directly to the field, which loads the unmapped rows from _source.
We treat this as a TypeConflictedField because it must still be resolved: via an implicit cast, an explicit cast, or fallback.
-
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
ConstructorsConstructorDescriptionPotentiallyUnmappedSingleTypeEsField(EsField mappedField, Set<String> mappedIndices) -
Method Summary
Modifier and TypeMethodDescriptionbooleanPer-source-type indices in which the field appears with that type.getWriteableName(TransportVersion transportVersion) This needs to be overridden by subclasses for specific serializationinthashCode()booleanWhether the field is unmapped in at least one index, in which case it's treated asDataType.KEYWORDwhere it is unmapped.types()Source data types observed for this field across all indices.voidwriteContent(StreamOutput out) This needs to be overridden by subclasses for specific serializationMethods inherited from class org.elasticsearch.xpack.esql.core.type.TypeConflictedField
errorMessage, getExactField, getExactInfo, isSingleTypePotentiallyUnmapped, singleMappedType, singleMappedTypeWidenedMethods inherited from class org.elasticsearch.xpack.esql.core.type.EsField
getDataType, getName, getNodeStringName, getProperties, getReader, getTimeSeriesFieldType, isAggregatable, isAlias, readFrom, readTimeSeriesFieldType, toString, withDataType, withWidenedSmallNumeric, writeTimeSeriesFieldType, writeTo
-
Constructor Details
-
PotentiallyUnmappedSingleTypeEsField
-
-
Method Details
-
mappedField
-
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
-
types
Description copied from class:TypeConflictedFieldSource data types observed for this field across all indices.- Specified by:
typesin classTypeConflictedField
-
getTypesToIndices
Description copied from class:TypeConflictedFieldPer-source-type indices in which the field appears with that type. Note thatCompactInvalidMappedFieldcaps each set and may include the"..."sentinel; callers that need a complete index list should useInvalidMappedFieldinstead.- Specified by:
getTypesToIndicesin classTypeConflictedField
-
isPotentiallyUnmapped
public boolean isPotentiallyUnmapped()Description copied from class:TypeConflictedFieldWhether the field is unmapped in at least one index, in which case it's treated asDataType.KEYWORDwhere it is unmapped.- Specified by:
isPotentiallyUnmappedin classTypeConflictedField
-
hashCode
public int hashCode() -
equals
-