java.lang.Object
java.lang.Enum<DateDiff.Part>
org.elasticsearch.xpack.esql.expression.function.scalar.date.DateDiff.Part
All Implemented Interfaces:
Serializable, Comparable<DateDiff.Part>, Constable, DateTimeField
Enclosing class:
DateDiff

public static enum DateDiff.Part extends Enum<DateDiff.Part> implements DateTimeField
Represents units that can be used for DATE_DIFF function and how the difference between 2 dates is calculated
  • Enum Constant Details

  • Method Details

    • values

      public static DateDiff.Part[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DateDiff.Part valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • diff

      public Integer diff(ZonedDateTime startTimestamp, ZonedDateTime endTimestamp)
    • aliases

      public Iterable<String> aliases()
      Specified by:
      aliases in interface DateTimeField
    • resolve

      public static DateDiff.Part resolve(String dateTimeUnit)