Class GenericRow

Object
io.delta.kernel.internal.data.GenericRow
All Implemented Interfaces:
Row
Direct Known Subclasses:
ScanStateRow, TransactionStateRow

public class GenericRow extends Object implements Row
Exposes a given map of values as a Row
  • Constructor Summary

    Constructors
    Constructor
    Description
    GenericRow(StructType schema, Map<Integer,Object> ordinalToValue)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getArray(int ordinal)
    Return array value of the column located at the given ordinal.
    byte[]
    getBinary(int ordinal)
    Return binary value of the column located at the given ordinal.
    boolean
    getBoolean(int ordinal)
    Return boolean value of the column located at the given ordinal.
    byte
    getByte(int ordinal)
    Return byte value of the column located at the given ordinal.
    getDecimal(int ordinal)
    Return decimal value of the column located at the given ordinal.
    double
    getDouble(int ordinal)
    Return double value of the column located at the given ordinal.
    float
    getFloat(int ordinal)
    Return float value of the column located at the given ordinal.
    int
    getInt(int ordinal)
    Return integer value of the column located at the given ordinal.
    long
    getLong(int ordinal)
    Return long value of the column located at the given ordinal.
    getMap(int ordinal)
    Return map value of the column located at the given ordinal.
     
    short
    getShort(int ordinal)
    Return short value of the column located at the given ordinal.
    getString(int ordinal)
    Return string value of the column located at the given ordinal.
    getStruct(int ordinal)
    Return struct value of the column located at the given ordinal.
    boolean
    isNullAt(int ordinal)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GenericRow

      public GenericRow(StructType schema, Map<Integer,Object> ordinalToValue)
      Parameters:
      schema - the schema of the row
      ordinalToValue - a mapping of column ordinal to objects; for each column the object must be of the return type corresponding to the data type's getter method in the Row interface
  • Method Details

    • getSchema

      public StructType getSchema()
      Specified by:
      getSchema in interface Row
      Returns:
      Schema of the record.
    • isNullAt

      public boolean isNullAt(int ordinal)
      Specified by:
      isNullAt in interface Row
      Parameters:
      ordinal - the ordinal of the column to check
      Returns:
      whether the column at ordinal is null
    • getBoolean

      public boolean getBoolean(int ordinal)
      Description copied from interface: Row
      Return boolean value of the column located at the given ordinal. Throws error if the column at given ordinal is not of boolean type,
      Specified by:
      getBoolean in interface Row
    • getByte

      public byte getByte(int ordinal)
      Description copied from interface: Row
      Return byte value of the column located at the given ordinal. Throws error if the column at given ordinal is not of boolean type,
      Specified by:
      getByte in interface Row
    • getShort

      public short getShort(int ordinal)
      Description copied from interface: Row
      Return short value of the column located at the given ordinal. Throws error if the column at given ordinal is not of boolean type,
      Specified by:
      getShort in interface Row
    • getInt

      public int getInt(int ordinal)
      Description copied from interface: Row
      Return integer value of the column located at the given ordinal. Throws error if the column at given ordinal is not of integer type,
      Specified by:
      getInt in interface Row
    • getLong

      public long getLong(int ordinal)
      Description copied from interface: Row
      Return long value of the column located at the given ordinal. Throws error if the column at given ordinal is not of long type,
      Specified by:
      getLong in interface Row
    • getFloat

      public float getFloat(int ordinal)
      Description copied from interface: Row
      Return float value of the column located at the given ordinal. Throws error if the column at given ordinal is not of long type,
      Specified by:
      getFloat in interface Row
    • getDouble

      public double getDouble(int ordinal)
      Description copied from interface: Row
      Return double value of the column located at the given ordinal. Throws error if the column at given ordinal is not of long type,
      Specified by:
      getDouble in interface Row
    • getString

      public String getString(int ordinal)
      Description copied from interface: Row
      Return string value of the column located at the given ordinal. Throws error if the column at given ordinal is not of varchar type,
      Specified by:
      getString in interface Row
    • getDecimal

      public BigDecimal getDecimal(int ordinal)
      Description copied from interface: Row
      Return decimal value of the column located at the given ordinal. Throws error if the column at given ordinal is not of decimal type,
      Specified by:
      getDecimal in interface Row
    • getBinary

      public byte[] getBinary(int ordinal)
      Description copied from interface: Row
      Return binary value of the column located at the given ordinal. Throws error if the column at given ordinal is not of varchar type,
      Specified by:
      getBinary in interface Row
    • getStruct

      public Row getStruct(int ordinal)
      Description copied from interface: Row
      Return struct value of the column located at the given ordinal. Throws error if the column at given ordinal is not of struct type,
      Specified by:
      getStruct in interface Row
    • getArray

      public ArrayValue getArray(int ordinal)
      Description copied from interface: Row
      Return array value of the column located at the given ordinal. Throws error if the column at given ordinal is not of array type,
      Specified by:
      getArray in interface Row
    • getMap

      public MapValue getMap(int ordinal)
      Description copied from interface: Row
      Return map value of the column located at the given ordinal. Throws error if the column at given ordinal is not of map type,
      Specified by:
      getMap in interface Row