Record Class IndexResolver.FieldsInfo

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.session.IndexResolver.FieldsInfo
Record Components:
caps - FieldCapabilitiesResponse from all indices involved in the query
minTransportVersion - The minimum TransportVersion of any node that might receive the request. More precisely, it's the minimum transport version of ALL nodes in ALL the clusters that the query is targeting. It doesn't matter if the node is a data node or an ML node or a unicorn, it's transport version counts. BUT if the query doesn't dispatch to that cluster AT ALL, we don't count the versions of any nodes in that cluster.

If any remote didn't tell us the version we assume that it's very, very old. This effectively disables any fields that were created "recently". Which is appropriate because those fields are not supported on *almost* all versions that don't return the transport version in the response.

"Very, very old" above means that there are versions of Elasticsearch that we're wire compatible that with that don't support sending the version back. That's anything from 8.19.FIRST to 9.2.0. "Recently" means any field types we added support for after the initial release of ESQL. These fields use SupportedVersion.supportedOn(org.elasticsearch.TransportVersion, boolean) rather than SupportedVersion.SUPPORTED_ON_ALL_NODES. Except for DATE_NANOS. For DATE_NANOS we got lucky/made a mistake. It wasn't widely used before ESQL added support for it and we weren't careful about enabling it. So queries on mixed version clusters that touch DATE_NANOS will fail. All the types added after that, like DENSE_VECTOR, will gracefully disable themselves when talking to older nodes.

currentBuildIsSnapshot - is the current build a snapshot? Note: This is always Build.current().isSnapshot() in production but tests need more control
useAggregateMetricDoubleWhenNotSupported - does the query itself force us to use aggregate_metric_double fields even if the remotes don't report that they support the type? This exists because some remotes do support aggregate_metric_double without reporting that they do. And, for a while, we used the query itself to opt into reading these fields.
useDenseVectorWhenNotSupported - does the query itself force us to use dense_vector fields even if the remotes don't report that they support the type? This exists because some remotes do support dense_vector without reporting that they do. And, for a while, we used the query itself to opt into reading these fields.
Enclosing class:
IndexResolver

public static record IndexResolver.FieldsInfo(FieldCapabilitiesResponse caps, TransportVersion minTransportVersion, boolean currentBuildIsSnapshot, boolean useAggregateMetricDoubleWhenNotSupported, boolean useDenseVectorWhenNotSupported) extends Record
Information for resolving a field.
  • Constructor Details

  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • caps

      Returns the value of the caps record component.
      Returns:
      the value of the caps record component
    • minTransportVersion

      @Nullable public TransportVersion minTransportVersion()
      Returns the value of the minTransportVersion record component.
      Returns:
      the value of the minTransportVersion record component
    • currentBuildIsSnapshot

      public boolean currentBuildIsSnapshot()
      Returns the value of the currentBuildIsSnapshot record component.
      Returns:
      the value of the currentBuildIsSnapshot record component
    • useAggregateMetricDoubleWhenNotSupported

      public boolean useAggregateMetricDoubleWhenNotSupported()
      Returns the value of the useAggregateMetricDoubleWhenNotSupported record component.
      Returns:
      the value of the useAggregateMetricDoubleWhenNotSupported record component
    • useDenseVectorWhenNotSupported

      public boolean useDenseVectorWhenNotSupported()
      Returns the value of the useDenseVectorWhenNotSupported record component.
      Returns:
      the value of the useDenseVectorWhenNotSupported record component