Class MultiTypeEsField
java.lang.Object
org.elasticsearch.xpack.esql.core.type.EsField
org.elasticsearch.xpack.esql.core.type.UnionTypeEsField
org.elasticsearch.xpack.esql.core.type.MultiTypeEsField
- All Implemented Interfaces:
Writeable
N.B.: This class exists only as a backward-compatible version of CompactMultiTypeEsField.
InvalidMappedField holds that information and allows for later resolution of the field
to a single type in ResolveUnionTypes.
If the plan contains a converted field attribute with mapping conflict, like EVAL x = x::long, this conversion
is fused into the FieldAttribute and represented by an instance of
this class instead of the InvalidMappedField.
This class is sent to the data nodes to inform them that they have to convert the type directly during field extraction.-
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
ConstructorsModifierConstructorDescriptionMultiTypeEsField(String name, DataType dataType, boolean aggregatable, Map<String, Expression> indexToConversionExpressions, EsField.TimeSeriesFieldType timeSeriesFieldType, Expression potentiallyUnmappedExpression) protected -
Method Summary
Modifier and TypeMethodDescriptionbooleangetConversionExpressionForIndex(String indexName) Conversion expression to apply when the field is unmapped in the index (treating it asDataType.KEYWORD) ornullif there is no such conversion (i.e., unmapped indices should producenull).getWriteableName(TransportVersion transportVersion) This needs to be overridden by subclasses for specific serializationinthashCode()static MultiTypeEsFieldresolveFrom(TypeConflictedField typeConflictedField, Map<String, Expression> typesToConversionExpressions) rewrapWithCast(Expression convertExpression) Wraps an existing union-type field's per-(index|type) conversions with another conversion expression on top, so the composite expression first does the original cast then the additional cast.toString()withPotentiallyUnmappedExpression(Expression potentiallyUnmappedExpression) Returns a copy of this field with the given unmapped conversion expression.voidwriteContent(StreamOutput out) This needs to be overridden by subclasses for specific serializationMethods inherited from class org.elasticsearch.xpack.esql.core.type.EsField
getDataType, getExactField, getExactInfo, getName, getProperties, getReader, getTimeSeriesFieldType, isAggregatable, isAlias, readFrom, readTimeSeriesFieldType, withDataType, withWidenedSmallNumeric, writeTimeSeriesFieldType, writeTo
-
Constructor Details
-
MultiTypeEsField
public MultiTypeEsField(String name, DataType dataType, boolean aggregatable, Map<String, Expression> indexToConversionExpressions, EsField.TimeSeriesFieldType timeSeriesFieldType, @Nullable Expression potentiallyUnmappedExpression) -
MultiTypeEsField
- Throws:
IOException
-
-
Method Details
-
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
-
getNodeStringName
- Overrides:
getNodeStringNamein classEsField
-
getPotentiallyUnmappedExpression
-
getUnmappedConversionExpression
Description copied from class:UnionTypeEsFieldConversion expression to apply when the field is unmapped in the index (treating it asDataType.KEYWORD) ornullif there is no such conversion (i.e., unmapped indices should producenull).- Specified by:
getUnmappedConversionExpressionin classUnionTypeEsField
-
getIndexToConversionExpressions
-
getConversionExpressions
- Specified by:
getConversionExpressionsin classUnionTypeEsField
-
rewrapWithCast
Description copied from class:UnionTypeEsFieldWraps an existing union-type field's per-(index|type) conversions with another conversion expression on top, so the composite expression first does the original cast then the additional cast.- Specified by:
rewrapWithCastin classUnionTypeEsField
-
getConversionExpressionForIndex
-
withPotentiallyUnmappedExpression
Description copied from class:UnionTypeEsFieldReturns a copy of this field with the given unmapped conversion expression.- Specified by:
withPotentiallyUnmappedExpressionin classUnionTypeEsField
-
resolveFrom
public static MultiTypeEsField resolveFrom(TypeConflictedField typeConflictedField, Map<String, Expression> typesToConversionExpressions) -
equals
-
hashCode
public int hashCode() -
toString
-