Class 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.
    • Constructor Detail

      • EnrichedRowData

        public EnrichedRowData​(org.apache.flink.table.data.RowData fixedRow,
                               int[] indexMapping)
    • Method Detail

      • replaceMutableRow

        public EnrichedRowData replaceMutableRow​(org.apache.flink.table.data.RowData mutableRow)
        Replaces the mutable RowData backing this EnrichedRowData.

        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:
        getArity in interface org.apache.flink.table.data.RowData
      • getRowKind

        public org.apache.flink.types.RowKind getRowKind()
        Specified by:
        getRowKind in interface org.apache.flink.table.data.RowData
      • setRowKind

        public void setRowKind​(org.apache.flink.types.RowKind kind)
        Specified by:
        setRowKind in interface org.apache.flink.table.data.RowData
      • isNullAt

        public boolean isNullAt​(int pos)
        Specified by:
        isNullAt in interface org.apache.flink.table.data.RowData
      • getBoolean

        public boolean getBoolean​(int pos)
        Specified by:
        getBoolean in interface org.apache.flink.table.data.RowData
      • getByte

        public byte getByte​(int pos)
        Specified by:
        getByte in interface org.apache.flink.table.data.RowData
      • getShort

        public short getShort​(int pos)
        Specified by:
        getShort in interface org.apache.flink.table.data.RowData
      • getInt

        public int getInt​(int pos)
        Specified by:
        getInt in interface org.apache.flink.table.data.RowData
      • getLong

        public long getLong​(int pos)
        Specified by:
        getLong in interface org.apache.flink.table.data.RowData
      • getFloat

        public float getFloat​(int pos)
        Specified by:
        getFloat in interface org.apache.flink.table.data.RowData
      • getDouble

        public double getDouble​(int pos)
        Specified by:
        getDouble in interface org.apache.flink.table.data.RowData
      • getString

        public org.apache.flink.table.data.StringData getString​(int pos)
        Specified by:
        getString in interface org.apache.flink.table.data.RowData
      • getDecimal

        public org.apache.flink.table.data.DecimalData getDecimal​(int pos,
                                                                  int precision,
                                                                  int scale)
        Specified by:
        getDecimal in interface org.apache.flink.table.data.RowData
      • getTimestamp

        public org.apache.flink.table.data.TimestampData getTimestamp​(int pos,
                                                                      int precision)
        Specified by:
        getTimestamp in interface org.apache.flink.table.data.RowData
      • getRawValue

        public <T> org.apache.flink.table.data.RawValueData<T> getRawValue​(int pos)
        Specified by:
        getRawValue in interface org.apache.flink.table.data.RowData
      • getBinary

        public byte[] getBinary​(int pos)
        Specified by:
        getBinary in interface org.apache.flink.table.data.RowData
      • getArray

        public org.apache.flink.table.data.ArrayData getArray​(int pos)
        Specified by:
        getArray in interface org.apache.flink.table.data.RowData
      • getMap

        public org.apache.flink.table.data.MapData getMap​(int pos)
        Specified by:
        getMap in interface org.apache.flink.table.data.RowData
      • getRow

        public org.apache.flink.table.data.RowData getRow​(int pos,
                                                          int numFields)
        Specified by:
        getRow in interface org.apache.flink.table.data.RowData
      • getVariant

        public org.apache.flink.types.variant.Variant getVariant​(int pos)
        Specified by:
        getVariant in interface org.apache.flink.table.data.RowData
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • from

        public static EnrichedRowData from​(org.apache.flink.table.data.RowData fixedRow,
                                           List<String> producedRowFields,
                                           List<String> mutableRowFields,
                                           List<String> fixedRowFields)
        Creates a new EnrichedRowData with the provided fixedRow as the immutable static row, and uses the producedRowFields, fixedRowFields and mutableRowFields arguments to compute the indexes mapping.

        The producedRowFields should include the name of fields of the full row once mutable and fixed rows are merged, while fixedRowFields and mutableRowFields should 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)