Interface FieldAccessor

All Known Subinterfaces:
PqStruct, PqVariantObject, RowReader, StructAccessor

public interface FieldAccessor

Common interface for name-based access to fields whose values are primitives, Variants, or absent. Shared by both Parquet-struct accessors (StructAccessor) and Variant-object accessors (PqVariantObject), and by top-level RowReader.

Complex Parquet-only accessors (getStruct / getList / getMap) live on StructAccessor. Variant-specific accessors (getObject / getArray) live on PqVariantObject.

  • Method Details

    • getInt

      int getInt(String name)
      Get an INT32 field value by name.
      Parameters:
      name - the field name
      Returns:
      the int value
      Throws:
      NullPointerException - if the field is null
      IllegalArgumentException - if the field type is not INT32
    • getLong

      long getLong(String name)
      Get an INT64 field value by name.
      Parameters:
      name - the field name
      Returns:
      the long value
      Throws:
      NullPointerException - if the field is null
      IllegalArgumentException - if the field type is not INT64
    • getFloat

      float getFloat(String name)
      Get a FLOAT field value by name.
      Parameters:
      name - the field name
      Returns:
      the float value
      Throws:
      NullPointerException - if the field is null
      IllegalArgumentException - if the field type is not FLOAT
    • getDouble

      double getDouble(String name)
      Get a DOUBLE field value by name.
      Parameters:
      name - the field name
      Returns:
      the double value
      Throws:
      NullPointerException - if the field is null
      IllegalArgumentException - if the field type is not DOUBLE
    • getBoolean

      boolean getBoolean(String name)
      Get a BOOLEAN field value by name.
      Parameters:
      name - the field name
      Returns:
      the boolean value
      Throws:
      NullPointerException - if the field is null
      IllegalArgumentException - if the field type is not BOOLEAN
    • getString

      String getString(String name)
      Get a STRING field value by name.
      Parameters:
      name - the field name
      Returns:
      the string value, or null if the field is null
      Throws:
      IllegalArgumentException - if the field type is not STRING
    • getBinary

      byte[] getBinary(String name)
      Get a BINARY field value by name.
      Parameters:
      name - the field name
      Returns:
      the byte array, or null if the field is null
      Throws:
      IllegalArgumentException - if the field type is not BINARY
    • getDate

      LocalDate getDate(String name)
      Get a DATE field value by name.
      Parameters:
      name - the field name
      Returns:
      the date value, or null if the field is null
      Throws:
      IllegalArgumentException - if the field type is not DATE
    • getTime

      LocalTime getTime(String name)
      Get a TIME field value by name.
      Parameters:
      name - the field name
      Returns:
      the time value, or null if the field is null
      Throws:
      IllegalArgumentException - if the field type is not TIME
    • getTimestamp

      Instant getTimestamp(String name)
      Get a TIMESTAMP field value by name.
      Parameters:
      name - the field name
      Returns:
      the instant value, or null if the field is null
      Throws:
      IllegalArgumentException - if the field type is not TIMESTAMP
    • getDecimal

      BigDecimal getDecimal(String name)
      Get a DECIMAL field value by name.
      Parameters:
      name - the field name
      Returns:
      the decimal value, or null if the field is null
      Throws:
      IllegalArgumentException - if the field type is not DECIMAL
    • getUuid

      UUID getUuid(String name)
      Get a UUID field value by name.
      Parameters:
      name - the field name
      Returns:
      the UUID value, or null if the field is null
      Throws:
      IllegalArgumentException - if the field type is not UUID
    • getInterval

      PqInterval getInterval(String name)

      Get an INTERVAL field value by name.

      The Parquet INTERVAL logical type stores three independent components (months, days, milliseconds) as little-endian unsigned 32-bit integers in a 12-byte FIXED_LEN_BYTE_ARRAY. The components are not normalized into a single duration. See PqInterval for component semantics.

      Parameters:
      name - the field name
      Returns:
      the interval value, or null if the field is null
      Throws:
      IllegalArgumentException - if the field type is not INTERVAL
    • getVariant

      PqVariant getVariant(String name)
      Get a VARIANT field value by name. Works both for a Parquet group annotated with the VARIANT logical type (where the returned value is assembled from the underlying metadata + value binary columns) and for a Variant object's field whose value is itself a Variant — every Variant sub-value can be surfaced through this method.
      Parameters:
      name - the field name
      Returns:
      the Variant accessor, or null if the field is null
      Throws:
      IllegalArgumentException - if the field is not annotated as VARIANT
    • getValue

      Object getValue(String name)
      Get a field value by name without type conversion. Returns the raw value as stored internally.
      Parameters:
      name - the field name
      Returns:
      the raw value, or null if the field is null
    • isNull

      boolean isNull(String name)
      Check if a field is null by name.
      Parameters:
      name - the field name
      Returns:
      true if the field is null
    • getFieldCount

      int getFieldCount()
      Get the number of fields in this record.
      Returns:
      the field count
    • getFieldName

      String getFieldName(int index)
      Get the name of a field by index.
      Parameters:
      index - the field index (0-based)
      Returns:
      the field name