Skip to main content
Package com.gpudb

Class GenericRecord

All Implemented Interfaces:
Record, Serializable, org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecord

public final class GenericRecord extends RecordBase implements Serializable
An object that contains Record data based on a GPUdb Type specified at runtime. GPUdb functions that return non-dynamic data will use generic records by default in the absence of a specified type descriptor or known type.
  • Constructor Details

    • GenericRecord

      public GenericRecord(Type type)
      Creates a new generic record based on the specified GPUdb Type. Note that generic records can also be created using Type.newInstance().
      Parameters:
      type - the GPUdb type
  • Method Details

    • getType

      public Type getType()
      Description copied from interface: Record
      Returns the GPUdb Type of the record.
      Specified by:
      getType in interface Record
      Returns:
      the GPUdb type
    • get

      public Object get(int index)
      Description copied from interface: Record
      Returns the value of the specified field.
      Specified by:
      get in interface org.apache.avro.generic.IndexedRecord
      Specified by:
      get in interface Record
      Parameters:
      index - the index of the field
      Returns:
      the value of the field
    • put

      public void put(int index, Object value)
      Description copied from interface: Record
      Sets the value of the specified field.
      Specified by:
      put in interface org.apache.avro.generic.IndexedRecord
      Specified by:
      put in interface Record
      Parameters:
      index - the index of the field
      value - the new value