public interface RowRecord
fieldName - value pairs.
It provides APIs to allow retrieval of values through fieldName lookup. For example,
if (row.isNullAt("int_field")) {
// handle the null value.
} else {
int x = getInt("int_field");
}
StructType,
StructField| Modifier and Type | Method and Description |
|---|---|
java.math.BigDecimal |
getBigDecimal(String fieldName)
Retrieves value from data record and returns the value as a
java.math.BigDecimal. |
byte[] |
getBinary(String fieldName)
Retrieves value from data record and returns the value as binary (byte array).
|
boolean |
getBoolean(String fieldName)
Retrieves value from data record and returns the value as a primitive boolean.
|
byte |
getByte(String fieldName)
Retrieves value from data record and returns the value as a primitive byte.
|
java.sql.Date |
getDate(String fieldName)
Retrieves value from data record and returns the value as a
java.sql.Date. |
double |
getDouble(String fieldName)
Retrieves value from data record and returns the value as a primitive double.
|
float |
getFloat(String fieldName)
Retrieves value from data record and returns the value as a primitive float.
|
int |
getInt(String fieldName)
Retrieves value from data record and returns the value as a primitive int.
|
int |
getLength() |
<T> java.util.List<T> |
getList(String fieldName)
Retrieves value from data record and returns the value as a
java.util.List<T> object. |
long |
getLong(String fieldName)
Retrieves value from data record and returns the value as a primitive long.
|
<K,V> java.util.Map<K,V> |
getMap(String fieldName)
Retrieves value from data record and returns the value as a
java.util.Map<K, V>
object. |
RowRecord |
getRecord(String fieldName)
Retrieves value from data record and returns the value as a
RowRecord object. |
StructType |
getSchema() |
short |
getShort(String fieldName)
Retrieves value from data record and returns the value as a primitive short.
|
String |
getString(String fieldName)
Retrieves value from data record and returns the value as a
String object. |
java.sql.Timestamp |
getTimestamp(String fieldName)
Retrieves value from data record and returns the value as a
java.sql.Timestamp. |
boolean |
isNullAt(String fieldName) |
StructType getSchema()
RowRecordint getLength()
RowRecordboolean isNullAt(String fieldName)
fieldName - name of field/column, not nullfieldName is nullint getInt(String fieldName)
fieldName - name of field/column, not nullfieldName as a primitive intIllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if null data value readlong getLong(String fieldName)
fieldName - name of field/column, not nullfieldName as a primitive longIllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if null data value readbyte getByte(String fieldName)
fieldName - name of field/column, not nullfieldName as a primitive byteIllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if null data value readshort getShort(String fieldName)
fieldName - name of field/column, not nullfieldName as a primitive shortIllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if null data value readboolean getBoolean(String fieldName)
fieldName - name of field/column, not nullfieldName as a primitive booleanIllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if null data value readfloat getFloat(String fieldName)
fieldName - name of field/column, not nullfieldName as a primitive floatIllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if null data value readdouble getDouble(String fieldName)
fieldName - name of field/column, not nullfieldName as a primitive doubleIllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if null data value readString getString(String fieldName)
String object.fieldName - name of field/column, not nullfieldName as a String object. null only if
null value read and field is nullable.IllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if field is not nullable and null data value readbyte[] getBinary(String fieldName)
fieldName - name of field/column, not nullfieldName as binary (byte array). null only if
null value read and field is nullable.IllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if field is not nullable and null data value readjava.math.BigDecimal getBigDecimal(String fieldName)
java.math.BigDecimal.fieldName - name of field/column, not nullfieldName as java.math.BigDecimal. null only if
null value read and field is nullable.IllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if field is not nullable and null data value readjava.sql.Timestamp getTimestamp(String fieldName)
java.sql.Timestamp.fieldName - name of field/column, not nullfieldName as java.sql.Timestamp. null only if
null value read and field is nullable.IllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if field is not nullable and null data value readjava.sql.Date getDate(String fieldName)
java.sql.Date.fieldName - name of field/column, not nullfieldName as java.sql.Date. null only if
null value read and field is nullable.IllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - if field is not nullable and null data value readRowRecord getRecord(String fieldName)
RowRecord object.fieldName - name of field/column, not nullfieldName as a RowRecord object.
null only if null value read and field is nullable.IllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - for this field or any nested field, if that field is not
nullable and null data value read<T> java.util.List<T> getList(String fieldName)
java.util.List<T> object.T - element typefieldName - name of field/column, not nullfieldName as a java.util.List<T> object.
null only if null value read and field is nullable.IllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - for this field or any element field, if that field is not
nullable and null data value read<K,V> java.util.Map<K,V> getMap(String fieldName)
java.util.Map<K, V>
object.K - key typeV - value typefieldName - name of field/column, not nullfieldName as a java.util.Map<K, V> object.
null only if null value read and field is nullable.IllegalArgumentException - if fieldName does not exist in this schemaClassCastException - if data type does not matchNullPointerException - for this field or any key/value field, if that field is not
nullable and null data value read