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 Summary
Modifier and TypeMethodDescriptionbyte[]Get a BINARY field value by name.booleangetBoolean(String name) Get a BOOLEAN field value by name.Get a DATE field value by name.getDecimal(String name) Get a DECIMAL field value by name.doubleGet a DOUBLE field value by name.intGet the number of fields in this record.getFieldName(int index) Get the name of a field by index.floatGet a FLOAT field value by name.intGet an INT32 field value by name.getInterval(String name) Get an INTERVAL field value by name.longGet an INT64 field value by name.Get a STRING field value by name.Get a TIME field value by name.getTimestamp(String name) Get a TIMESTAMP field value by name.Get a UUID field value by name.Get a field value by name without type conversion.getVariant(String name) Get a VARIANT field value by name.booleanCheck if a field is null by name.
-
Method Details
-
getInt
Get an INT32 field value by name.- Parameters:
name- the field name- Returns:
- the int value
- Throws:
NullPointerException- if the field is nullIllegalArgumentException- if the field type is not INT32
-
getLong
Get an INT64 field value by name.- Parameters:
name- the field name- Returns:
- the long value
- Throws:
NullPointerException- if the field is nullIllegalArgumentException- if the field type is not INT64
-
getFloat
Get a FLOAT field value by name.- Parameters:
name- the field name- Returns:
- the float value
- Throws:
NullPointerException- if the field is nullIllegalArgumentException- if the field type is not FLOAT
-
getDouble
Get a DOUBLE field value by name.- Parameters:
name- the field name- Returns:
- the double value
- Throws:
NullPointerException- if the field is nullIllegalArgumentException- if the field type is not DOUBLE
-
getBoolean
Get a BOOLEAN field value by name.- Parameters:
name- the field name- Returns:
- the boolean value
- Throws:
NullPointerException- if the field is nullIllegalArgumentException- if the field type is not BOOLEAN
-
getString
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
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
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
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
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
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
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
Get an INTERVAL field value by name.
The Parquet
INTERVALlogical 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. SeePqIntervalfor 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
Get a VARIANT field value by name. Works both for a Parquet group annotated with theVARIANTlogical type (where the returned value is assembled from the underlyingmetadata+valuebinary 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
-
isNull
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
Get the name of a field by index.- Parameters:
index- the field index (0-based)- Returns:
- the field name
-