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 two parts: NumericColumnSource and GenericColumnSource (and their mutable counterparts MutableNumericColumnSource and MutableGenericColumnSource).

ColumnSource is for representing columns containing the numeric Deephaven types (int8_t, int16_t, int32_t, int64_t, float, double), whereas ColumnSource is for representing the remaining Deephaven types (bool, std::string, and DateTime).

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::column::NumericColumnSource< T >, 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 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 >, deephaven::dhcore::column::MutableNumericColumnSource< 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 NumericColumnSource : public virtual deephaven::dhcore::column::ColumnSource

Refinement of ColumnSource for the Deephaven numeric types (int8_t, int16_t, etc).

Subclassed by deephaven::dhcore::column::MutableNumericColumnSource< T >, deephaven::dhcore::column::NumericBufferColumnSource< T >, deephaven::dhcore::immerutil::NumericImmerColumnSource< T >

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

Refinement of ColumnSource for the Deephaven non-numeric types (bool, string, DateTime).

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

template<typename T>
class MutableNumericColumnSource : public deephaven::dhcore::column::NumericColumnSource<T>, public deephaven::dhcore::column::MutableColumnSource

Subclassed by deephaven::dhcore::column::NumericArrayColumnSource< 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 = NumericColumnSource<int8_t>

Convenience using.

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

Convenience using.

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

Convenience using.

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

Convenience using.

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

Convenience using.

using deephaven::dhcore::column::DoubleColumnSource = NumericColumnSource<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.

Utility Declarations

class ColumnSourceVisitor

Implements the visitor pattern for ColumnSource.

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

Public Functions

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.