Record Class PqInterval

java.lang.Object
java.lang.Record
dev.hardwood.row.PqInterval
Record Components:
months - number of months (unsigned 32-bit, range 0–4,294,967,295)
days - number of days (unsigned 32-bit, range 0–4,294,967,295)
milliseconds - number of milliseconds (unsigned 32-bit, range 0–4,294,967,295)

public record PqInterval(long months, long days, long milliseconds) extends Record

Value type for the Parquet INTERVAL logical type.

The three components are stored independently — they are not normalized (e.g. 90 days is not converted to ~3 months) because the calendar semantics of months and days vary. The on-disk encoding is a 12-byte FIXED_LEN_BYTE_ARRAY: three little-endian unsigned 32-bit integers in the order months, days, milliseconds.

Each component is exposed as a long holding its unsigned 32-bit value, so all values are in the range [0, 4_294_967_295].

  • Constructor Summary

    Constructors
    Constructor
    Description
    PqInterval(long months, long days, long milliseconds)
    Creates an instance of a PqInterval record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the days record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the milliseconds record component.
    long
    Returns the value of the months record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PqInterval

      public PqInterval(long months, long days, long milliseconds)
      Creates an instance of a PqInterval record class.
      Parameters:
      months - the value for the months record component
      days - the value for the days record component
      milliseconds - the value for the milliseconds record component
  • Method Details

    • 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 the compare method from their corresponding wrapper classes.
      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.
    • months

      public long months()
      Returns the value of the months record component.
      Returns:
      the value of the months record component
    • days

      public long days()
      Returns the value of the days record component.
      Returns:
      the value of the days record component
    • milliseconds

      public long milliseconds()
      Returns the value of the milliseconds record component.
      Returns:
      the value of the milliseconds record component