OmniSciDB
a5dc49c757
|
#include <ArrayNoneEncoder.h>
Public Member Functions | |
ArrayNoneEncoder (AbstractBuffer *buffer) | |
size_t | getNumElemsForBytesInsertData (const std::vector< ArrayDatum > *srcData, const int start_idx, const size_t numAppendElems, const size_t byteLimit, const bool replicating=false) |
size_t | getNumElemsForBytesEncodedDataAtIndices (const int8_t *index_data, const std::vector< size_t > &selected_idx, const size_t byte_limit) override |
std::shared_ptr< ChunkMetadata > | appendData (int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating=false, const int64_t offset=-1) override |
std::shared_ptr< ChunkMetadata > | appendEncodedDataAtIndices (const int8_t *index_data, int8_t *data, const std::vector< size_t > &selected_idx) override |
std::shared_ptr< ChunkMetadata > | appendEncodedData (const int8_t *index_data, int8_t *data, const size_t start_idx, const size_t num_elements) override |
std::shared_ptr< ChunkMetadata > | appendData (const std::vector< ArrayDatum > *srcData, const int start_idx, const size_t numAppendElems, const bool replicating) |
void | getMetadata (const std::shared_ptr< ChunkMetadata > &chunkMetadata) override |
std::shared_ptr< ChunkMetadata > | getMetadata (const SQLTypeInfo &ti) override |
void | updateStats (const int64_t, const bool) override |
void | updateStats (const double, const bool) override |
void | updateStats (const int8_t *const src_data, const size_t num_elements) override |
void | updateStats (const std::vector< std::string > *const src_data, const size_t start_idx, const size_t num_elements) override |
void | updateStats (const std::vector< ArrayDatum > *const src_data, const size_t start_idx, const size_t num_elements) override |
void | reduceStats (const Encoder &) override |
void | writeMetadata (FILE *f) override |
void | readMetadata (FILE *f) override |
void | copyMetadata (const Encoder *copyFromEncoder) override |
AbstractBuffer * | getIndexBuf () const |
bool | resetChunkStats (const ChunkStats &stats) override |
: Reset chunk level stats (min, max, nulls) using new values from the argument. More... | |
void | resetChunkStats () override |
void | setIndexBuffer (AbstractBuffer *buf) |
Public Member Functions inherited from Encoder | |
Encoder (Data_Namespace::AbstractBuffer *buffer) | |
virtual | ~Encoder () |
virtual void | updateStatsEncoded (const int8_t *const dst_data, const size_t num_elements) |
size_t | getNumElems () const |
void | setNumElems (const size_t num_elems) |
Public Attributes | |
Datum | elem_min |
Datum | elem_max |
bool | has_nulls |
bool | initialized |
Static Public Attributes | |
static constexpr size_t | DEFAULT_NULL_PADDING_SIZE {8} |
Private Member Functions | |
void | update_elem_stats (const ArrayDatum &array) |
std::pair< ArrayOffsetT, ArrayOffsetT > | getArrayOffsetsAtIndex (const int8_t *index_data, size_t index) |
size_t | getArrayDatumSizeAtIndex (const int8_t *index_data, size_t index) |
ArrayDatum | getArrayDatumAtIndex (const int8_t *index_data, int8_t *data, size_t index) |
Private Attributes | |
std::mutex | EncoderMutex_ |
AbstractBuffer * | index_buf |
ArrayOffsetT | last_offset |
Additional Inherited Members | |
Static Public Member Functions inherited from Encoder | |
static Encoder * | Create (Data_Namespace::AbstractBuffer *buffer, const SQLTypeInfo sqlType) |
Protected Attributes inherited from Encoder | |
size_t | num_elems_ |
Data_Namespace::AbstractBuffer * | buffer_ |
DecimalOverflowValidator | decimal_overflow_validator_ |
DateDaysOverflowValidator | date_days_overflow_validator_ |
Definition at line 41 of file ArrayNoneEncoder.h.
|
inline |
Definition at line 43 of file ArrayNoneEncoder.h.
|
inlineoverridevirtual |
Append data to the chunk buffer backing this encoder.
src_data | Source data for the append |
num_elems_to_append | Number of elements to append |
ti | SQL Type Info for the column TODO(adb): used? |
replicating | Pass one value and fill the chunk with it |
offset | Write data starting at a given offset. Default is -1 which indicates an append, an offset of 0 rewrites the chunk up to num_elems_to_append . |
Implements Encoder.
Definition at line 84 of file ArrayNoneEncoder.h.
References UNREACHABLE.
Referenced by Chunk_NS::Chunk::appendData(), appendEncodedData(), and appendEncodedDataAtIndices().
|
inline |
Definition at line 118 of file ArrayNoneEncoder.h.
References Data_Namespace::AbstractBuffer::append(), Encoder::buffer_, CHECK, Data_Namespace::CPU_LEVEL, DEFAULT_NULL_PADDING_SIZE, run_benchmark_import::dest, getMetadata(), index_buf, is_null(), Data_Namespace::AbstractBuffer::isDirty(), last_offset, MAX_INPUT_BUF_SIZE, anonymous_namespace{Utm.h}::n, Encoder::num_elems_, Data_Namespace::AbstractBuffer::read(), Data_Namespace::AbstractBuffer::reserve(), Data_Namespace::AbstractBuffer::setDirty(), Data_Namespace::AbstractBuffer::size(), and update_elem_stats().
|
inlineoverridevirtual |
Append encoded data to the chunk buffer backing this encoder.
index_data | - (optional) the index data of data to append |
data | - the data to append |
start_idx | - the position to start encoding from in the data array |
num_elements | - the number of elements to encode from the data array |
NOTE: index_data
must be non-null for varlen encoder types.
Implements Encoder.
Definition at line 105 of file ArrayNoneEncoder.h.
References appendData(), and getArrayDatumAtIndex().
|
inlineoverridevirtual |
Append selected encoded data to the chunk buffer backing this encoder.
index_data | - (optional) the index data of data to append |
data | - the data to append |
selected_idx | - which indices in the encoded data to append |
NOTE: index_data
must be non-null for varlen encoder types.
Implements Encoder.
Definition at line 93 of file ArrayNoneEncoder.h.
References appendData(), and getArrayDatumAtIndex().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 297 of file ArrayNoneEncoder.h.
References elem_max, elem_min, Encoder::getNumElems(), has_nulls, initialized, and Encoder::num_elems_.
|
inlineprivate |
Definition at line 581 of file ArrayNoneEncoder.h.
References getArrayOffsetsAtIndex(), is_null(), and last_offset.
Referenced by appendEncodedData(), and appendEncodedDataAtIndices().
|
inlineprivate |
Definition at line 575 of file ArrayNoneEncoder.h.
References getArrayOffsetsAtIndex(), and last_offset.
Referenced by getNumElemsForBytesEncodedDataAtIndices().
|
inlineprivate |
Definition at line 566 of file ArrayNoneEncoder.h.
References last_offset.
Referenced by getArrayDatumAtIndex(), and getArrayDatumSizeAtIndex().
|
inline |
|
inlineoverridevirtual |
Reimplemented from Encoder.
Definition at line 243 of file ArrayNoneEncoder.h.
References elem_max, elem_min, Encoder::getMetadata(), and has_nulls.
Referenced by appendData().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 249 of file ArrayNoneEncoder.h.
References elem_max, elem_min, and has_nulls.
|
inlineoverridevirtual |
Compute the maximum number of variable length encoded elements given a byte limit
index_data | - (optional) index data for the encoded type |
selected_idx | - which indices in the encoded data to consider |
byte_limit | - byte limit that must be respected |
NOTE: optional parameters above may be ignored by the implementation, but may or may not be required depending on the encoder type backing the implementation.
Implements Encoder.
Definition at line 68 of file ArrayNoneEncoder.h.
References getArrayDatumSizeAtIndex().
|
inline |
Definition at line 50 of file ArrayNoneEncoder.h.
References anonymous_namespace{Utm.h}::n.
Referenced by Chunk_NS::Chunk::getNumElemsForBytesInsertData().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 288 of file ArrayNoneEncoder.h.
References elem_max, elem_min, has_nulls, initialized, and Encoder::num_elems_.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
: Reset chunk level stats (min, max, nulls) using new values from the argument.
Reimplemented from Encoder.
Definition at line 308 of file ArrayNoneEncoder.h.
References Encoder::buffer_, DatumEqual(), elem_max, elem_min, SQLTypeInfo::get_elem_type(), Data_Namespace::AbstractBuffer::getSqlType(), ChunkStats::has_nulls, has_nulls, initialized, ChunkStats::max, and ChunkStats::min.
|
inlineoverridevirtual |
Resets chunk metadata stats to their default values.
Implements Encoder.
Definition at line 320 of file ArrayNoneEncoder.h.
References has_nulls, and initialized.
|
inline |
Definition at line 329 of file ArrayNoneEncoder.h.
References EncoderMutex_, and index_buf.
Referenced by Chunk_NS::Chunk::initEncoder().
|
inlineprivate |
Definition at line 341 of file ArrayNoneEncoder.h.
References Datum::bigintval, Datum::boolval, Encoder::buffer_, CHECK_EQ, Datum::doubleval, elem_max, elem_min, Datum::floatval, SQLTypeInfo::get_compression(), SQLTypeInfo::get_subtype(), Data_Namespace::AbstractBuffer::getSqlType(), has_nulls, initialized, Datum::intval, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kENCODING_DICT, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, NULL_BIGINT, NULL_BOOLEAN, NULL_DOUBLE, NULL_FLOAT, NULL_INT, NULL_SMALLINT, NULL_TINYINT, Datum::smallintval, Datum::tinyintval, and UNREACHABLE.
Referenced by appendData(), and updateStats().
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Update statistics for data without appending.
src_data | - the data with which to update statistics |
num_elements | - the number of elements to scan in the data |
Implements Encoder.
Definition at line 259 of file ArrayNoneEncoder.h.
References CHECK.
|
inlineoverridevirtual |
Update statistics for string data without appending.
src_data | - the string data with which to update statistics |
start_idx | - the offset into src_data to start the update |
num_elements | - the number of elements to scan in the string data |
Implements Encoder.
Definition at line 263 of file ArrayNoneEncoder.h.
References UNREACHABLE.
|
inlineoverridevirtual |
Update statistics for array data without appending.
src_data | - the array data with which to update statistics |
start_idx | - the offset into src_data to start the update |
num_elements | - the number of elements to scan in the array data |
Implements Encoder.
Definition at line 269 of file ArrayNoneEncoder.h.
References anonymous_namespace{Utm.h}::n, and update_elem_stats().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 279 of file ArrayNoneEncoder.h.
References elem_max, elem_min, has_nulls, initialized, and Encoder::num_elems_.
|
static |
Definition at line 334 of file ArrayNoneEncoder.h.
Referenced by appendData(), Fragmenter_Namespace::get_null_padding(), ColumnFetcher::linearizeVarLenArrayColFrags(), and foreign_storage::ParquetVariableLengthArrayEncoder::setFirstOffsetForBuffer().
Datum ArrayNoneEncoder::elem_max |
Definition at line 326 of file ArrayNoneEncoder.h.
Referenced by copyMetadata(), getMetadata(), readMetadata(), resetChunkStats(), update_elem_stats(), and writeMetadata().
Datum ArrayNoneEncoder::elem_min |
Definition at line 325 of file ArrayNoneEncoder.h.
Referenced by copyMetadata(), getMetadata(), readMetadata(), resetChunkStats(), update_elem_stats(), and writeMetadata().
|
private |
Definition at line 337 of file ArrayNoneEncoder.h.
Referenced by setIndexBuffer().
bool ArrayNoneEncoder::has_nulls |
Definition at line 327 of file ArrayNoneEncoder.h.
Referenced by copyMetadata(), getMetadata(), heavydb.thrift.ttypes.TColumnRange::read(), readMetadata(), resetChunkStats(), update_elem_stats(), heavydb.thrift.ttypes.TColumnRange::write(), and writeMetadata().
|
private |
Definition at line 338 of file ArrayNoneEncoder.h.
Referenced by appendData(), getIndexBuf(), and setIndexBuffer().
bool ArrayNoneEncoder::initialized |
Definition at line 328 of file ArrayNoneEncoder.h.
Referenced by copyMetadata(), readMetadata(), resetChunkStats(), update_elem_stats(), and writeMetadata().
|
private |
Definition at line 339 of file ArrayNoneEncoder.h.
Referenced by appendData(), getArrayDatumAtIndex(), getArrayDatumSizeAtIndex(), and getArrayOffsetsAtIndex().