Class TypeConflictedField

java.lang.Object
org.elasticsearch.xpack.esql.core.type.EsField
org.elasticsearch.xpack.esql.core.type.TypeConflictedField
All Implemented Interfaces:
Writeable
Direct Known Subclasses:
CompactInvalidMappedField, InvalidMappedField, PotentiallyUnmappedSingleTypeEsField

public abstract sealed class TypeConflictedField extends EsField permits InvalidMappedField, CompactInvalidMappedField, PotentiallyUnmappedSingleTypeEsField
  • Constructor Details

  • Method Details

    • getExactField

      public EsField getExactField()
      Description copied from class: EsField
      Returns 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 exception EsField.getExactInfo() should be used beforehand, to check if an exact field exists and if not get the errorMessage which explains why is that.
      Overrides:
      getExactField in class EsField
    • getExactInfo

      public EsField.Exact getExactInfo()
      Description copied from class: EsField
      Returns and EsField.Exact object 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:
      getExactInfo in class EsField
    • errorMessage

      public String errorMessage()
    • getTypesToIndices

      public abstract Map<String,Set<String>> getTypesToIndices()
      Per-source-type indices in which the field appears with that type. Note that CompactInvalidMappedField caps each set and may include the "..." sentinel; callers that need a complete index list should use InvalidMappedField instead.
    • isPotentiallyUnmapped

      public abstract boolean isPotentiallyUnmapped()
      Whether the field is unmapped in at least one index, in which case it's treated as DataType.KEYWORD where it is unmapped.
    • types

      public abstract Set<DataType> types()
      Source data types observed for this field across all indices.
    • isSingleTypePotentiallyUnmapped

      public boolean isSingleTypePotentiallyUnmapped()
      A "two-legged PUNK": a field that is mapped to a single type in some indices and unmapped in others. Under unmapped_fields="load" this is not a genuine type conflict — values are loaded where the field is mapped and are null where it is unmapped.
    • singleMappedType

      public DataType singleMappedType()
      The single mapped source type (e.g. SHORT). Only valid when isSingleTypePotentiallyUnmapped().
    • singleMappedTypeWidened

      public DataType singleMappedTypeWidened()
      The single mapped type widened to its ES|QL surface type (e.g. SHORT -> INTEGER), so the implicit load matches an explicit cast and agrees with the Fork/UnionAll output. Only valid when isSingleTypePotentiallyUnmapped().