Class EnrichedRowData
java.lang.Object
org.apache.flink.connector.file.table.EnrichedRowData
- All Implemented Interfaces:
org.apache.flink.table.data.RowData
@Internal
public class EnrichedRowData
extends Object
implements org.apache.flink.table.data.RowData
An implementation of
RowData which is backed by two RowData with a well-defined
index mapping, One of the rows is fixed, while the other can be swapped for performant changes in
hot code paths. The RowKind is inherited from the mutable row.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.table.data.RowData
org.apache.flink.table.data.RowData.FieldGetter -
Constructor Summary
ConstructorsConstructorDescriptionEnrichedRowData(org.apache.flink.table.data.RowData fixedRow, int[] indexMapping) -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]computeIndexMapping(List<String> producedRowFields, List<String> mutableRowFields, List<String> fixedRowFields) This method computes the index mapping forEnrichedRowData.booleanstatic EnrichedRowDatafrom(org.apache.flink.table.data.RowData fixedRow, List<String> producedRowFields, List<String> mutableRowFields, List<String> fixedRowFields) Creates a newEnrichedRowDatawith the providedfixedRowas the immutable static row, and uses theproducedRowFields,fixedRowFieldsandmutableRowFieldsarguments to compute the indexes mapping.intgetArity()org.apache.flink.table.data.ArrayDatagetArray(int pos) byte[]getBinary(int pos) booleangetBoolean(int pos) bytegetByte(int pos) org.apache.flink.table.data.DecimalDatagetDecimal(int pos, int precision, int scale) doublegetDouble(int pos) floatgetFloat(int pos) intgetInt(int pos) longgetLong(int pos) org.apache.flink.table.data.MapDatagetMap(int pos) <T> org.apache.flink.table.data.RawValueData<T>getRawValue(int pos) org.apache.flink.table.data.RowDatagetRow(int pos, int numFields) org.apache.flink.types.RowKindshortgetShort(int pos) org.apache.flink.table.data.StringDatagetString(int pos) org.apache.flink.table.data.TimestampDatagetTimestamp(int pos, int precision) inthashCode()booleanisNullAt(int pos) replaceMutableRow(org.apache.flink.table.data.RowData mutableRow) Replaces the mutableRowDatabacking thisEnrichedRowData.voidsetRowKind(org.apache.flink.types.RowKind kind) toString()
-
Constructor Details
-
EnrichedRowData
public EnrichedRowData(org.apache.flink.table.data.RowData fixedRow, int[] indexMapping)
-
-
Method Details
-
replaceMutableRow
Replaces the mutableRowDatabacking thisEnrichedRowData.This method replaces the mutable row data in place and does not return a new object. This is done for performance reasons.
-
getArity
public int getArity()- Specified by:
getArityin interfaceorg.apache.flink.table.data.RowData
-
getRowKind
public org.apache.flink.types.RowKind getRowKind()- Specified by:
getRowKindin interfaceorg.apache.flink.table.data.RowData
-
setRowKind
public void setRowKind(org.apache.flink.types.RowKind kind) - Specified by:
setRowKindin interfaceorg.apache.flink.table.data.RowData
-
isNullAt
public boolean isNullAt(int pos) - Specified by:
isNullAtin interfaceorg.apache.flink.table.data.RowData
-
getBoolean
public boolean getBoolean(int pos) - Specified by:
getBooleanin interfaceorg.apache.flink.table.data.RowData
-
getByte
public byte getByte(int pos) - Specified by:
getBytein interfaceorg.apache.flink.table.data.RowData
-
getShort
public short getShort(int pos) - Specified by:
getShortin interfaceorg.apache.flink.table.data.RowData
-
getInt
public int getInt(int pos) - Specified by:
getIntin interfaceorg.apache.flink.table.data.RowData
-
getLong
public long getLong(int pos) - Specified by:
getLongin interfaceorg.apache.flink.table.data.RowData
-
getFloat
public float getFloat(int pos) - Specified by:
getFloatin interfaceorg.apache.flink.table.data.RowData
-
getDouble
public double getDouble(int pos) - Specified by:
getDoublein interfaceorg.apache.flink.table.data.RowData
-
getString
public org.apache.flink.table.data.StringData getString(int pos) - Specified by:
getStringin interfaceorg.apache.flink.table.data.RowData
-
getDecimal
public org.apache.flink.table.data.DecimalData getDecimal(int pos, int precision, int scale) - Specified by:
getDecimalin interfaceorg.apache.flink.table.data.RowData
-
getTimestamp
public org.apache.flink.table.data.TimestampData getTimestamp(int pos, int precision) - Specified by:
getTimestampin interfaceorg.apache.flink.table.data.RowData
-
getRawValue
public <T> org.apache.flink.table.data.RawValueData<T> getRawValue(int pos) - Specified by:
getRawValuein interfaceorg.apache.flink.table.data.RowData
-
getBinary
public byte[] getBinary(int pos) - Specified by:
getBinaryin interfaceorg.apache.flink.table.data.RowData
-
getArray
public org.apache.flink.table.data.ArrayData getArray(int pos) - Specified by:
getArrayin interfaceorg.apache.flink.table.data.RowData
-
getMap
public org.apache.flink.table.data.MapData getMap(int pos) - Specified by:
getMapin interfaceorg.apache.flink.table.data.RowData
-
getRow
public org.apache.flink.table.data.RowData getRow(int pos, int numFields) - Specified by:
getRowin interfaceorg.apache.flink.table.data.RowData
-
equals
-
hashCode
public int hashCode() -
toString
-
from
public static EnrichedRowData from(org.apache.flink.table.data.RowData fixedRow, List<String> producedRowFields, List<String> mutableRowFields, List<String> fixedRowFields) Creates a newEnrichedRowDatawith the providedfixedRowas the immutable static row, and uses theproducedRowFields,fixedRowFieldsandmutableRowFieldsarguments to compute the indexes mapping.The
producedRowFieldsshould include the name of fields of the full row once mutable and fixed rows are merged, whilefixedRowFieldsandmutableRowFieldsshould contain respectively the field names of fixed row and mutable row. All the lists are ordered with indexes matching the position of the field in the row. As an example, for a complete row(a, b, c)the mutable row might be(a, c)and the fixed row might be(b) -
computeIndexMapping
public static int[] computeIndexMapping(List<String> producedRowFields, List<String> mutableRowFields, List<String> fixedRowFields) This method computes the index mapping forEnrichedRowData.- See Also:
-