Record Class ApproximationSettings

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.approximation.ApproximationSettings
Record Components:
rows - The number of rows used for query approximation. If null, the default will be used.
confidenceLevel - The confidence level of the confidence intervals returned by query approximation. If null, the default will be used.
All Implemented Interfaces:
Writeable

public record ApproximationSettings(Integer rows, Double confidenceLevel) extends Record implements Writeable
Settings for query approximation.
  • Field Details

    • DEFAULT

      public static final ApproximationSettings DEFAULT
      Default approximation settings, when it's enabled but no specific settings are provided.
    • EXPLICIT_NULL

      public static final ApproximationSettings EXPLICIT_NULL
      Sentinel approximation settings representing an explicit NULL, meaning "revert to null" during merge.
  • Constructor Details

    • ApproximationSettings

      public ApproximationSettings(StreamInput in) throws IOException
      Throws:
      IOException
    • ApproximationSettings

      public ApproximationSettings(Integer rows, Double confidenceLevel)
      Creates an instance of a ApproximationSettings record class.
      Parameters:
      rows - the value for the rows record component
      confidenceLevel - the value for the confidenceLevel record component
  • Method Details

    • rows

      public Integer rows()
      Returns the number of rows to be used for query approximation. If null, the framework tries to pick a suitable number for the query.
    • confidenceLevel

      public Double confidenceLevel()
      Returns the request confidence level. If none is set, the default level is returned. If null is explicitly set, no confidence intervals should be computed.
    • fromXContent

      public static ApproximationSettings fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • parse

      public static ApproximationSettings parse(Expression expression)
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.