@PublicEvolving public interface RecordData
RecordData describes the data of changed record (i.e. row) in the external system.
The mappings from external 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 |StringData| +--------------------------------+-----------------------------------------+ | BINARY / VARBINARY / BYTES | byte[] | +--------------------------------+-----------------------------------------+ | DECIMAL |DecimalData| +--------------------------------+-----------------------------------------+ | 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 |TimestampData| +--------------------------------+-----------------------------------------+ | TIMESTAMP WITH LOCAL TIME ZONE |LocalZonedTimestampData| +--------------------------------+-----------------------------------------+ | TIMESTAMP WITH TIME ZONE |ZonedTimestampData| +--------------------------------+-----------------------------------------+ | ROW |RecordData| +--------------------------------+-----------------------------------------+ | ARRAY |ArrayData| +--------------------------------+-----------------------------------------+ | MAP |MapData| +--------------------------------+-----------------------------------------+
Nullability is always handled by the container data structure.
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
RecordData.FieldGetter
Accessor for getting the field of a RecordData during runtime.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static RecordData.FieldGetter |
createFieldGetter(DataType fieldType,
int fieldPos)
Creates an accessor for getting elements in an internal RecordData structure at the given
position.
|
int |
getArity()
Returns the number of fields in this record.
|
ArrayData |
getArray(int pos)
Returns the array value at the given position.
|
byte[] |
getBinary(int pos)
Returns the binary value at the given position.
|
boolean |
getBoolean(int pos)
Returns the boolean value at the given position.
|
byte |
getByte(int pos)
Returns the byte value at the given position.
|
DecimalData |
getDecimal(int pos,
int precision,
int scale)
Returns the decimal value at the given position.
|
double |
getDouble(int pos)
Returns the double value at the given position.
|
float |
getFloat(int pos)
Returns the float value at the given position.
|
int |
getInt(int pos)
Returns the integer value at the given position.
|
LocalZonedTimestampData |
getLocalZonedTimestampData(int pos,
int precision)
Returns the local zoned timestamp value at the given position.
|
long |
getLong(int pos)
Returns the long value at the given position.
|
MapData |
getMap(int pos)
Returns the map value at the given position.
|
RecordData |
getRow(int pos,
int numFields)
Returns the row value at the given position.
|
short |
getShort(int pos)
Returns the short value at the given position.
|
StringData |
getString(int pos)
Returns the string value at the given position.
|
TimestampData |
getTimestamp(int pos,
int precision)
Returns the timestamp value at the given position.
|
ZonedTimestampData |
getZonedTimestamp(int pos,
int precision)
Returns the zoned timestamp value at the given position.
|
boolean |
isNullAt(int pos)
Returns true if the field is null at the given position.
|
int getArity()
boolean isNullAt(int pos)
boolean getBoolean(int pos)
byte getByte(int pos)
short getShort(int pos)
int getInt(int pos)
long getLong(int pos)
float getFloat(int pos)
double getDouble(int pos)
byte[] getBinary(int pos)
StringData getString(int pos)
DecimalData getDecimal(int pos, int precision, int scale)
The precision and scale are required to determine whether the decimal value was stored in
a compact representation (see DecimalData).
TimestampData getTimestamp(int pos, int precision)
The precision is required to determine whether the timestamp value was stored in a compact
representation (see TimestampData).
ZonedTimestampData getZonedTimestamp(int pos, int precision)
The precision is required to determine whether the zoned timestamp value was stored in a
compact representation (see ZonedTimestampData).
LocalZonedTimestampData getLocalZonedTimestampData(int pos, int precision)
The precision is required to determine whether the local zoned timestamp value was stored
in a compact representation (see LocalZonedTimestampData).
ArrayData getArray(int pos)
MapData getMap(int pos)
RecordData getRow(int pos, int numFields)
The number of fields is required to correctly extract the record.
static RecordData.FieldGetter createFieldGetter(DataType fieldType, int fieldPos)
fieldType - the element type of the RecordDatafieldPos - the element position of the RecordDataCopyright © 2025 The Apache Software Foundation. All rights reserved.