Record Class DependencyList

Object
Record
org.apache.spark.sql.connector.catalog.DependencyList
Record Components:
dependencies - array of dependencies; must contain no null elements (defensive copy made; not validated element-wise -- callers passing nulls will surface NPEs in downstream consumers)

@Evolving public record DependencyList(Dependency[] dependencies) extends Record
A list of dependencies for a SQL object such as a view or metric view.

  • When null, the dependency information is not provided.
  • When the array is empty, dependencies are provided but the object has none.
  • When the array is non-empty, each entry describes one dependency.

Records' auto-generated equals/hashCode on array fields fall through to Object.equals(java.lang.Object) (reference equality), so this record overrides them to use Arrays.equals(Object[], Object[]) / Arrays.hashCode(Object[]) on dependencies; per-element equality delegates to the element's overridden equals (TableDependency / FunctionDependency both implement value semantics on their nameParts array). The defensive-copy accessor override clones on read so callers cannot mutate the record's internal array.

Since:
4.2.0
  • Constructor Details

    • DependencyList

      public DependencyList(Dependency[] dependencies)
      Creates an instance of a DependencyList record class.
      Parameters:
      dependencies - the value for the dependencies record component
  • Method Details

    • dependencies

      public Dependency[] dependencies()
      Returns a defensive copy of the underlying dependencies array.
    • equals

      public 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.
    • hashCode

      public 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
    • toString

      public 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
    • of

      public static DependencyList of(Dependency[] dependencies)