Class YearMonthIntervalType

Object
org.apache.spark.sql.types.DataType
org.apache.spark.sql.types.YearMonthIntervalType
All Implemented Interfaces:
Serializable, scala.Equals, scala.Product, scala.Serializable

public class YearMonthIntervalType extends DataType implements scala.Product, scala.Serializable
The type represents year-month intervals of the SQL standard. A year-month interval is made up of a contiguous subset of the following fields: - MONTH, months within years [0..11], - YEAR, years in the range [0..178956970].

YearMonthIntervalType represents positive as well as negative year-month intervals.

param: startField The leftmost field which the type comprises of. Valid values: 0 (YEAR), 1 (MONTH). param: endField The rightmost field which the type comprises of. Valid values: 0 (YEAR), 1 (MONTH).

Since:
3.2.0
See Also:
  • Constructor Details

    • YearMonthIntervalType

      public YearMonthIntervalType(byte startField, byte endField)
  • Method Details

    • YEAR

      public static byte YEAR()
    • MONTH

      public static byte MONTH()
    • yearMonthFields

      public static scala.collection.Seq<Object> yearMonthFields()
    • fieldToString

      public static String fieldToString(byte field)
    • stringToField

      public static scala.collection.immutable.Map<String,Object> stringToField()
    • DEFAULT

      public static YearMonthIntervalType DEFAULT()
    • apply

      public static YearMonthIntervalType apply()
    • apply

      public static YearMonthIntervalType apply(byte field)
    • canEqual

      public abstract static boolean canEqual(Object that)
    • equals

      public abstract static boolean equals(Object that)
    • productElement

      public abstract static Object productElement(int n)
    • productArity

      public abstract static int productArity()
    • productIterator

      public static scala.collection.Iterator<Object> productIterator()
    • productPrefix

      public static String productPrefix()
    • startField

      public byte startField()
    • endField

      public byte endField()
    • defaultSize

      public int defaultSize()
      Year-month interval values always occupy 4 bytes. The YEAR field is constrained by the upper bound 178956970 to fit to Int.
      Specified by:
      defaultSize in class DataType
      Returns:
      (undocumented)
    • typeName

      public String typeName()
      Description copied from class: DataType
      Name of the type used in JSON serialization.
      Overrides:
      typeName in class DataType