Column Sources

Description

A ColumnSource is an abstract class representing a Deephaven column. It represents a read-only view on that column. There is a derived class, MutableColumnSource, which provides a writable interface.

You can access the data in a ColumnSource via its FillChunk and FillChunkUnordered methods. Likewise, you can store data into a MutableColumnSource via its FillFromChunk and FillFromChunkUnordered methods. These methods provide “bulk transfer” of data into and out of a ColumnSource. We do not provide any methods to access single elements of a ColumnSource because we want to encourage callers to use the more efficient bulk transfer methods.

The ColumnSource hierarchy is further divided into the generic type GenericColumnSource and its mutable counterpart MutableGenericColumnSource. These types are generic on the element type they contain.

Supported types

The following types are supported

Java type

C++ type

byte

int8_t

short

int16_t

int

int32_t

long

int64_t

float

float

double

double

boolean

bool

char

char16_t

java.lang.String

std::string

java.time.ZonedDateTime

DateTime

java.time.LocalDate

LocalDate

java.time.LocalTime

LocalTime

as well as lists of the above. Lists are stored in a custom container; the element type is std::shared_ptr<ContainerBase>

ContainerBase is described in the section on Containers.

For these types we have a set of convenience typedefs:

Declarations

class ColumnSource

Abstract class for providing read access to Deephaven column data.

Subclassed by deephaven::dhcore::column::GenericColumnSource< T >, deephaven::dhcore::column::MutableColumnSource, deephaven::dhcore::immerutil::ImmerColumnSource

Public Types

using BooleanChunk = deephaven::dhcore::chunk::BooleanChunk

Alias.

using Chunk = deephaven::dhcore::chunk::Chunk

Alias.

using UInt64Chunk = deephaven::dhcore::chunk::UInt64Chunk

Alias.

using RowSequence = deephaven::dhcore::container::RowSequence

Alias.

Public Functions

virtual ~ColumnSource()

Destructor.

virtual void FillChunk(const RowSequence &rows, Chunk *dest_data, BooleanChunk *optional_dest_null_flags) const = 0

Read the elements specified by ‘rows’ from this ColumnSource and store them sequentially in the Chunk specified by ‘destData’. Optionally (if ‘optionalDestNullFlags’ != nullptr), store a true/false value in the corresponding element of *optionalDestNullFlags according to whether the element represent a Deephaven Null or not.

Parameters:
  • rows – Specifies the elements (in position space) to be read from this ColumnSource.

  • dest_data – A Chunk to which the elements wil be copied. This Chunk must be of the correct concrete type. For example if this is an Int32ColumnSource, the Chunk needs to be an Int32Chunk.

  • optional_dest_null_flags – If this parameter is not null, then this BooleanChunk will be populated with true/false values according to whether the source element was null or not.

virtual void FillChunkUnordered(const UInt64Chunk &rows, Chunk *dest_data, BooleanChunk *optional_dest_null_flags) const = 0

Read the elements specified by ‘rows’ from this ColumnSource and store them sequentially in the Chunk specified by ‘destData’. Optionally (if ‘optionalDestNullFlags’ != nullptr), store a true/false value in the corresponding element of *optionalDestNullFlags according to whether the element represents a Deephaven Null. The difference between this method and FillChunk() is that in this method, the elements of ‘rows’ may be in arbitary order (that is, they are not assumed to be in increasing order).

Parameters:
  • rows – Specifies the elements (in position space) to be read from this ColumnSource.

  • dest_data – A Chunk to which the elements wil be copied. This Chunk must be of the correct concrete type. For example if this is an Int32ColumnSource, the Chunk needs to be an Int32Chunk.

  • optional_dest_null_flags – If this parameter is not null, then this BooleanChunk will be populated with true/false values according to whether the source element was null or not.

virtual const ElementType &GetElementType() const = 0

Get the ElementType of the ColumnSource

Returns:

The ElementType of this ColumnSource

virtual void AcceptVisitor(ColumnSourceVisitor *visitor) const = 0

Implement the Visitor pattern.

class MutableColumnSource : public virtual deephaven::dhcore::column::ColumnSource

Abstract class for providing write access to Deephaven column data.

Subclassed by deephaven::dhcore::column::MutableGenericColumnSource< T >

Public Functions

virtual void FillFromChunk(const Chunk &src_data, const BooleanChunk *optional_src_null_flags, const RowSequence &rows) = 0

Read the elements sequentially from ‘srcData’ and store them in this ColumnSource in positions specified by ‘rows’. Optionally (if ‘optionalSrcNullFlags’ != nullptr), read a true/false value in the corresponding element of *optionalSrcNullFlags which will indicate whether the src element represents a Deephaven Null value.

Parameters:
  • src_data – A Chunk from which the elements wil be copied. This Chunk must be of the correct concrete type. For example if this is an MutableInt32ColumnSource, the Chunk needs to be an Int32Chunk.

  • optional_src_null_flags – If this parameter is not null, then the nullness of the corresponding source element will be controlled by whether the corresponding value in this BooleanChunk is true or false.

  • rows – Specifies the elements (in position space) where the data will be written to this ColumnSource.

virtual void FillFromChunkUnordered(const Chunk &src_data, const BooleanChunk *optional_src_null_flags, const UInt64Chunk &row_keys) = 0

Read the elements sequentially from ‘srcData’ and store them in this ColumnSource in positions specified by ‘rows’. Optionally (if ‘optionalSrcNullFlags’ != nullptr), read a true/false value in the corresponding element of *optionalSrcNullFlags which will indicate whether the src element represents a Deephaven Null value. The difference between this method and FillFromChunk() is that in this method, the elements of ‘rows’ may be in arbitary order (that is, they are not assumed to be in increasing order).

Parameters:
  • src_data – A Chunk from which the elements wil be copied. This Chunk must be of the correct concrete type. For example if this is an MutableInt32ColumnSource, the Chunk needs to be an Int32Chunk.

  • optional_src_null_flags – If this parameter is not null, then the nullness of the corresponding source element will be controlled by whether the corresponding value in this BooleanChunk is true or false.

  • rows – Specifies the elements (in position space) where the data will be written to this ColumnSource.

template<typename T>
class GenericColumnSource : public virtual deephaven::dhcore::column::ColumnSource

Generic refinement of ColumnSource

Subclassed by deephaven::dhcore::column::ContainerColumnSource< T >, deephaven::dhcore::column::MutableGenericColumnSource< T >, deephaven::dhcore::column::NumericBufferColumnSource< T >, deephaven::dhcore::immerutil::GenericImmerColumnSource< T >, deephaven::dhcore::immerutil::NumericImmerColumnSource< T >

template<typename T>
class MutableGenericColumnSource : public deephaven::dhcore::column::GenericColumnSource<T>, public deephaven::dhcore::column::MutableColumnSource

Subclassed by deephaven::dhcore::column::GenericArrayColumnSource< T >

using deephaven::dhcore::column::Int8ColumnSource = GenericColumnSource<int8_t>

Convenience using.

using deephaven::dhcore::column::Int16ColumnSource = GenericColumnSource<int16_t>

Convenience using.

using deephaven::dhcore::column::Int32ColumnSource = GenericColumnSource<int32_t>

Convenience using.

using deephaven::dhcore::column::Int64ColumnSource = GenericColumnSource<int64_t>

Convenience using.

using deephaven::dhcore::column::FloatColumnSource = GenericColumnSource<float>

Convenience using.

using deephaven::dhcore::column::DoubleColumnSource = GenericColumnSource<double>

Convenience using.

using deephaven::dhcore::column::BooleanColumnSource = GenericColumnSource<bool>

Convenience using.

using deephaven::dhcore::column::StringColumnSource = GenericColumnSource<std::string>

Convenience using.

using deephaven::dhcore::column::DateTimeColumnSource = GenericColumnSource<deephaven::dhcore::DateTime>

Convenience using.

using deephaven::dhcore::column::LocalDateColumnSource = GenericColumnSource<deephaven::dhcore::LocalDate>

Convenience using.

using deephaven::dhcore::column::LocalTimeColumnSource = GenericColumnSource<deephaven::dhcore::LocalTime>

Convenience using.

using deephaven::dhcore::column::ContainerBaseColumnSource = GenericColumnSource<std::shared_ptr<deephaven::dhcore::container::ContainerBase>>

Convenience using.

Utility Declarations

class ColumnSourceVisitor

Implements the visitor pattern for ColumnSource.

Subclassed by deephaven::dhcore::column::internal::ElementTypeVisitor

Public Functions

virtual ~ColumnSourceVisitor() = default

Destructor.

virtual void Visit(const CharColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const Int8ColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const Int16ColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const Int32ColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const Int64ColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const FloatColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const DoubleColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const BooleanColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const StringColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const DateTimeColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const LocalDateColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const LocalTimeColumnSource&) = 0

Implements the visitor pattern.

virtual void Visit(const ContainerBaseColumnSource&) = 0

Implements the visitor pattern.