Interface RecordData
-
- All Known Implementing Classes:
BinaryRecordData,GenericRecordData
@PublicEvolving public interface RecordData
ClassRecordDatadescribes 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceRecordData.FieldGetterAccessor for getting the field of a RecordData during runtime.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static RecordData.FieldGettercreateFieldGetter(DataType fieldType, int fieldPos)Creates an accessor for getting elements in an internal RecordData structure at the given position.intgetArity()Returns the number of fields in this record.ArrayDatagetArray(int pos)Returns the array value at the given position.byte[]getBinary(int pos)Returns the binary value at the given position.booleangetBoolean(int pos)Returns the boolean value at the given position.bytegetByte(int pos)Returns the byte value at the given position.DateDatagetDate(int pos)Returns the Date data at the given position.DecimalDatagetDecimal(int pos, int precision, int scale)Returns the decimal value at the given position.doublegetDouble(int pos)Returns the double value at the given position.floatgetFloat(int pos)Returns the float value at the given position.intgetInt(int pos)Returns the integer value at the given position.LocalZonedTimestampDatagetLocalZonedTimestampData(int pos, int precision)Returns the local zoned timestamp value at the given position.longgetLong(int pos)Returns the long value at the given position.MapDatagetMap(int pos)Returns the map value at the given position.RecordDatagetRow(int pos, int numFields)Returns the row value at the given position.shortgetShort(int pos)Returns the short value at the given position.StringDatagetString(int pos)Returns the string value at the given position.TimeDatagetTime(int pos)Returns the Time data at the given position.TimestampDatagetTimestamp(int pos, int precision)Returns the timestamp value at the given position.VariantgetVariant(int pos)Returns the variant value at the given position.ZonedTimestampDatagetZonedTimestamp(int pos, int precision)Returns the zoned timestamp value at the given position.booleanisNullAt(int pos)Returns true if the field is null at the given position.
-
-
-
Method Detail
-
getArity
int getArity()
Returns the number of fields in this record.
-
isNullAt
boolean isNullAt(int pos)
Returns true if the field is null at the given position.
-
getBoolean
boolean getBoolean(int pos)
Returns the boolean value at the given position.
-
getByte
byte getByte(int pos)
Returns the byte value at the given position.
-
getShort
short getShort(int pos)
Returns the short value at the given position.
-
getInt
int getInt(int pos)
Returns the integer value at the given position.
-
getLong
long getLong(int pos)
Returns the long value at the given position.
-
getFloat
float getFloat(int pos)
Returns the float value at the given position.
-
getDouble
double getDouble(int pos)
Returns the double value at the given position.
-
getBinary
byte[] getBinary(int pos)
Returns the binary value at the given position.
-
getString
StringData getString(int pos)
Returns the string value at the given position.
-
getDecimal
DecimalData getDecimal(int pos, int precision, int scale)
Returns the decimal value at the given position.The precision and scale are required to determine whether the decimal value was stored in a compact representation (see
DecimalData).
-
getTimestamp
TimestampData getTimestamp(int pos, int precision)
Returns the timestamp value at the given position.The precision is required to determine whether the timestamp value was stored in a compact representation (see
TimestampData).
-
getZonedTimestamp
ZonedTimestampData getZonedTimestamp(int pos, int precision)
Returns the zoned timestamp value at the given position.The precision is required to determine whether the zoned timestamp value was stored in a compact representation (see
ZonedTimestampData).
-
getLocalZonedTimestampData
LocalZonedTimestampData getLocalZonedTimestampData(int pos, int precision)
Returns the local zoned timestamp value at the given position.The precision is required to determine whether the local zoned timestamp value was stored in a compact representation (see
LocalZonedTimestampData).
-
getArray
ArrayData getArray(int pos)
Returns the array value at the given position.
-
getMap
MapData getMap(int pos)
Returns the map value at the given position.
-
getRow
RecordData getRow(int pos, int numFields)
Returns the row value at the given position.The number of fields is required to correctly extract the record.
-
getDate
DateData getDate(int pos)
Returns the Date data at the given position.
-
getTime
TimeData getTime(int pos)
Returns the Time data at the given position.
-
getVariant
Variant getVariant(int pos)
Returns the variant value at the given position.
-
createFieldGetter
static RecordData.FieldGetter createFieldGetter(DataType fieldType, int fieldPos)
Creates an accessor for getting elements in an internal RecordData structure at the given position.- Parameters:
fieldType- the element type of the RecordDatafieldPos- the element position of the RecordData
-
-