Enum Class Volatility

java.lang.Object
java.lang.Enum<Volatility>
org.apache.datafusion.Volatility
All Implemented Interfaces:
Serializable, Comparable<Volatility>, Constable

public enum Volatility extends Enum<Volatility>
Volatility classification for a UDF. Mirrors DataFusion's Volatility enum.
  • IMMUTABLE — pure function: same inputs always produce the same output; safe to constant-fold and common-subexpression-eliminate.
  • STABLE — deterministic within a single query but not across queries (e.g., now()).
  • VOLATILE — may return a different value on every call (e.g., random()).
  • Enum Constant Details

    • IMMUTABLE

      public static final Volatility IMMUTABLE
    • STABLE

      public static final Volatility STABLE
    • VOLATILE

      public static final Volatility VOLATILE
  • Method Details

    • values

      public static Volatility[] 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 Volatility 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
    • code

      public byte code()
      Stable byte code for FFI.