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
    • 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
    • getFloat

      float getFloat(String name)
      Get a FLOAT field value by name. Also accepts FLOAT16 columns (FIXED_LEN_BYTE_ARRAY(2) annotated Float16Type); the 2-byte payload is losslessly widened to single-precision float.
      Parameters:
      name - the field name
      Returns:
      the float value
      Throws:
      NullPointerException - if the field is null
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • getValue

      Object getValue(String name)

      Get a field value by name, decoded to its logical-type representation.

      Returns the value in the same form as the typed accessors above: Integer / Long / Float / Double / Boolean for primitives, String for STRING, LocalDate for DATE, LocalTime for TIME, Instant for TIMESTAMP, BigDecimal for DECIMAL, UUID for UUID, PqInterval for INTERVAL, PqVariant for VARIANT, and byte[] for BYTE_ARRAY / FIXED_LEN_BYTE_ARRAY with no logical-type annotation. Nested groups surface as PqStruct / PqList / PqMap.

      Use getRawValue(String) to obtain the underlying physical value instead.

      Parameters:
      name - the field name
      Returns:
      the decoded value, or null if the field is null
    • getRawValue

      Object getRawValue(String name)
      Get a field value by name as its raw physical representation, without logical-type decoding. Primitive leaves surface as the underlying Integer / Long / Float / Double / Boolean / byte[]; e.g. a TIMESTAMP returns the underlying Long rather than an Instant, and a DECIMAL returns the underlying byte[] / Integer / Long. Nested groups (struct / list / map / variant) are still returned as their typed flyweights since they have no useful "raw" form.
      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