taco-db  0.1.0
Static Public Member Functions | Static Public Attributes | List of all members
taco::DataArray Struct Reference

DataArray is a plain byte array that can be stored as a Datum itself and stores the data of a few datum where we do not want to bother with creating a schema. More...

#include <base/datum.h>

Static Public Member Functions

static Datum From (const Datum *data, uint32_t n)
 Makes a deep copy of the data and stores them in a data array. More...
 
template<class SomeDatum >
static size_t GetArrayLength (SomeDatum &&d)
 Returns the array length of the DataArray stored in d. More...
 
template<class SomeDatum >
static Datum GetDatum (SomeDatum &&d, size_t i)
 Returns the ith Datum of the DataArray stored in d. More...
 

Static Public Attributes

constexpr static uint32_t VARLEN_MASK = 1u << 31
 

Detailed Description

DataArray is a plain byte array that can be stored as a Datum itself and stores the data of a few datum where we do not want to bother with creating a schema.

It is currently used for save points and rewinding in PlanExecNode. In addition the datum stored in the array may not exceed 2^31

Note that DataArray do not differentiate between zero-length value and a null value. A zero-length value becomes a null Datum when GetDatum() is called.

Member Function Documentation

◆ From()

static Datum taco::DataArray::From ( const Datum data,
uint32_t  n 
)
inlinestatic

Makes a deep copy of the data and stores them in a data array.

Returns the DataArray as a Datum that owns it.

It is undefined if n == 0.

◆ GetArrayLength()

template<class SomeDatum >
static size_t taco::DataArray::GetArrayLength ( SomeDatum &&  d)
inlinestatic

Returns the array length of the DataArray stored in d.

◆ GetDatum()

template<class SomeDatum >
static Datum taco::DataArray::GetDatum ( SomeDatum &&  d,
size_t  i 
)
inlinestatic

Returns the ith Datum of the DataArray stored in d.

The returned datum never owns the memory.

Member Data Documentation

◆ VARLEN_MASK

constexpr static uint32_t taco::DataArray::VARLEN_MASK = 1u << 31
staticconstexpr

The documentation for this struct was generated from the following file: