@Public public interface InternalRow extends DataGetters
RowType
.
The mappings from SQL data types to the internal data structures are listed in the following table:
+--------------------------------+-----------------------------------------+ | SQL Data Types | Internal Data Structures | +--------------------------------+-----------------------------------------+ | BOOLEAN | boolean | +--------------------------------+-----------------------------------------+ | CHAR / VARCHAR / STRING |BinaryString
| +--------------------------------+-----------------------------------------+ | BINARY / VARBINARY / BYTES | byte[] | +--------------------------------+-----------------------------------------+ | DECIMAL |Decimal
| +--------------------------------+-----------------------------------------+ | TINYINT | byte | +--------------------------------+-----------------------------------------+ | SMALLINT | short | +--------------------------------+-----------------------------------------+ | INT | int | +--------------------------------+-----------------------------------------+ | BIGINT | long | +--------------------------------+-----------------------------------------+ | FLOAT | float | +--------------------------------+-----------------------------------------+ | DOUBLE | double | +--------------------------------+-----------------------------------------+ | DATE | int (number of days since epoch) | +--------------------------------+-----------------------------------------+ | TIME | int (number of milliseconds of the day) | +--------------------------------+-----------------------------------------+ | TIMESTAMP |Timestamp
| +--------------------------------+-----------------------------------------+ | TIMESTAMP WITH LOCAL TIME ZONE |Timestamp
| +--------------------------------+-----------------------------------------+ | ROW |InternalRow
| +--------------------------------+-----------------------------------------+ | ARRAY |InternalArray
| +--------------------------------+-----------------------------------------+ | MAP / MULTISET |InternalMap
| +--------------------------------+-----------------------------------------+
Nullability is always handled by the container data structure.
GenericRow
,
JoinedRow
Modifier and Type | Interface and Description |
---|---|
static interface |
InternalRow.FieldGetter
Accessor for getting the field of a row during runtime.
|
Modifier and Type | Method and Description |
---|---|
static InternalRow.FieldGetter |
createFieldGetter(DataType fieldType,
int fieldPos)
Creates an accessor for getting elements in an internal row data structure at the given
position.
|
static Class<?> |
getDataClass(DataType type)
Returns the data class for the given
DataType . |
int |
getFieldCount()
Returns the number of fields in this row.
|
RowKind |
getRowKind()
Returns the kind of change that this row describes in a changelog.
|
void |
setRowKind(RowKind kind)
Sets the kind of change that this row describes in a changelog.
|
getArray, getBinary, getBoolean, getByte, getDecimal, getDouble, getFloat, getInt, getLong, getMap, getRow, getShort, getString, getTimestamp, isNullAt
int getFieldCount()
The number does not include RowKind
. It is kept separately.
RowKind getRowKind()
RowKind
void setRowKind(RowKind kind)
RowKind
static Class<?> getDataClass(DataType type)
DataType
.static InternalRow.FieldGetter createFieldGetter(DataType fieldType, int fieldPos)
fieldType
- the element type of the rowfieldPos
- the element position of the rowCopyright © 2023–2024 The Apache Software Foundation. All rights reserved.