Interface PqMap


public interface PqMap

Type-safe interface for accessing Parquet MAP values.

A MAP in Parquet is stored as a list of key-value entries. This interface provides type-safe access to the entries with dedicated accessor methods.

PqMap attributes = row.getMap("attributes");
for (PqMap.Entry entry : attributes.getEntries()) {
    String key = entry.getStringKey();
    int value = entry.getIntValue();
}

A PqMap and its PqMap.Entry objects are flyweights over the underlying read batch — accessors resolve to column data on each call. The flyweight is valid for as long as the batch it was obtained from is current; it is not safe to hold across rowReader.next() calls.

  • Method Details

    • getEntries

      List<PqMap.Entry> getEntries()
      Get all entries in this map.
      Returns:
      list of map entries
    • size

      int size()
      Get the number of entries in this map.
      Returns:
      the entry count
    • isEmpty

      boolean isEmpty()
      Check if this map is empty.
      Returns:
      true if the map has no entries
    • containsKey

      boolean containsKey(String key)
      True if this map contains an entry with the given STRING key.
      Throws:
      NullPointerException - if key is null
    • containsKey

      boolean containsKey(int key)
      True if this map contains an entry with the given INT32 key.
    • containsKey

      boolean containsKey(long key)
      True if this map contains an entry with the given INT64 key.
    • containsKey

      boolean containsKey(byte[] key)
      True if this map contains an entry with the given byte-array key. Byte equality follows [java.util.Arrays#equals(byte[], byte[])].
      Throws:
      NullPointerException - if key is null
    • getValue

      Object getValue(String key)

      Look up the decoded value for a STRING key.

      Returns the same form as PqMap.Entry.getValue(): boxed primitive, String, LocalDate, BigDecimal, PqStruct / PqList / PqMap for nested groups, etc.

      Returns:
      the decoded value, or null if the key is absent or its value is null
      Throws:
      NullPointerException - if key is null
    • getValue

      Object getValue(int key)
      Look up the decoded value for an INT32 key.
      Returns:
      the decoded value, or null if the key is absent or its value is null
    • getValue

      Object getValue(long key)
      Look up the decoded value for an INT64 key.
      Returns:
      the decoded value, or null if the key is absent or its value is null
    • getValue

      Object getValue(byte[] key)
      Look up the decoded value for a byte-array key. Byte equality follows [java.util.Arrays#equals(byte[], byte[])].
      Returns:
      the decoded value, or null if the key is absent or its value is null
      Throws:
      NullPointerException - if key is null
    • getRawValue

      Object getRawValue(String key)
      Look up the raw physical value for a STRING key — mirrors PqMap.Entry.getRawValue().
      Returns:
      the raw value, or null if the key is absent or its value is null
      Throws:
      NullPointerException - if key is null
    • getRawValue

      Object getRawValue(int key)
      Look up the raw physical value for an INT32 key — mirrors PqMap.Entry.getRawValue().
      Returns:
      the raw value, or null if the key is absent or its value is null
    • getRawValue

      Object getRawValue(long key)
      Look up the raw physical value for an INT64 key — mirrors PqMap.Entry.getRawValue().
      Returns:
      the raw value, or null if the key is absent or its value is null
    • getRawValue

      Object getRawValue(byte[] key)
      Look up the raw physical value for a byte-array key — mirrors PqMap.Entry.getRawValue(). Byte equality follows [java.util.Arrays#equals(byte[], byte[])].
      Returns:
      the raw value, or null if the key is absent or its value is null
      Throws:
      NullPointerException - if key is null