OmniSciDB
a5dc49c757
|
#include <FixedLengthEncoder.h>
Public Member Functions | |
FixedLengthEncoder (Data_Namespace::AbstractBuffer *buffer) | |
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 > | appendEncodedDataAtIndices (const int8_t *, int8_t *data, const std::vector< size_t > &selected_idx) override |
std::shared_ptr< ChunkMetadata > | appendEncodedData (const int8_t *, int8_t *data, const size_t start_idx, const size_t num_elements) 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 |
void | getMetadata (const std::shared_ptr< ChunkMetadata > &chunkMetadata) override |
std::shared_ptr< ChunkMetadata > | getMetadata (const SQLTypeInfo &ti) override |
void | updateStats (const int64_t val, const bool is_null) override |
void | updateStats (const double val, const bool is_null) override |
void | updateStats (const int8_t *const src_data, const size_t num_elements) override |
void | updateStatsEncoded (const int8_t *const dst_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 &that) override |
void | copyMetadata (const Encoder *copyFromEncoder) override |
void | writeMetadata (FILE *f) override |
void | readMetadata (FILE *f) override |
bool | resetChunkStats (const ChunkStats &stats) override |
: Reset chunk level stats (min, max, nulls) using new values from the argument. More... | |
void | resetChunkStats () override |
Public Member Functions inherited from Encoder | |
Encoder (Data_Namespace::AbstractBuffer *buffer) | |
virtual | ~Encoder () |
size_t | getNumElems () const |
void | setNumElems (const size_t num_elems) |
Public Attributes | |
T | dataMin |
T | dataMax |
bool | has_nulls |
Private Member Functions | |
std::shared_ptr< ChunkMetadata > | appendEncodedOrUnencodedData (int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating, const int64_t offset, const bool is_encoded) |
void | updateStatsWithAlreadyEncoded (const V &encoded_data) |
V | encodeDataAndUpdateStats (const T &unencoded_data) |
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 34 of file FixedLengthEncoder.h.
|
inline |
Definition at line 36 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::resetChunkStats().
|
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 75 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::appendEncodedOrUnencodedData().
|
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 66 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::appendEncodedOrUnencodedData().
Referenced by FixedLengthEncoder< T, V >::appendEncodedDataAtIndices().
|
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 49 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::appendEncodedData(), and shared::execute_over_contiguous_indices().
|
inlineprivate |
Definition at line 226 of file FixedLengthEncoder.h.
References Data_Namespace::AbstractBuffer::append(), Encoder::buffer_, CHECK, CHECK_GE, FixedLengthEncoder< T, V >::encodeDataAndUpdateStats(), FixedLengthEncoder< T, V >::getMetadata(), Encoder::num_elems_, Data_Namespace::AbstractBuffer::reserve(), FixedLengthEncoder< T, V >::resetChunkStats(), Data_Namespace::AbstractBuffer::size(), heavydb.dtypes::T, FixedLengthEncoder< T, V >::updateStatsWithAlreadyEncoded(), and Data_Namespace::AbstractBuffer::write().
Referenced by FixedLengthEncoder< T, V >::appendData(), and FixedLengthEncoder< T, V >::appendEncodedData().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 176 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, Encoder::getNumElems(), FixedLengthEncoder< T, V >::has_nulls, and Encoder::num_elems_.
|
inlineprivate |
Definition at line 289 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, Encoder::decimal_overflow_validator_, logger::ERROR, FixedLengthEncoder< T, V >::has_nulls, LOG, heavydb.dtypes::T, to_string(), and DecimalOverflowValidator::validate().
Referenced by FixedLengthEncoder< T, V >::appendEncodedOrUnencodedData(), and FixedLengthEncoder< T, V >::updateStats().
|
inlineoverridevirtual |
Reimplemented from Encoder.
Definition at line 84 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, Encoder::getMetadata(), and FixedLengthEncoder< T, V >::has_nulls.
Referenced by FixedLengthEncoder< T, V >::appendEncodedOrUnencodedData().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 90 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, and FixedLengthEncoder< T, V >::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 40 of file FixedLengthEncoder.h.
References UNREACHABLE.
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 193 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, FixedLengthEncoder< T, V >::has_nulls, Encoder::num_elems_, and heavydb.dtypes::T.
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 167 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, and FixedLengthEncoder< T, V >::has_nulls.
|
inlineoverridevirtual |
: Reset chunk level stats (min, max, nulls) using new values from the argument.
Reimplemented from Encoder.
Definition at line 201 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, ChunkStats::has_nulls, FixedLengthEncoder< T, V >::has_nulls, ChunkStats::max, and ChunkStats::min.
|
inlineoverridevirtual |
Resets chunk metadata stats to their default values.
Implements Encoder.
Definition at line 215 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, and FixedLengthEncoder< T, V >::has_nulls.
Referenced by FixedLengthEncoder< T, V >::appendEncodedOrUnencodedData(), and FixedLengthEncoder< T, V >::FixedLengthEncoder().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 97 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, FixedLengthEncoder< T, V >::has_nulls, and heavydb.dtypes::T.
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 108 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, FixedLengthEncoder< T, V >::has_nulls, and heavydb.dtypes::T.
|
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 118 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::encodeDataAndUpdateStats(), and heavydb.dtypes::T.
|
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 154 of file FixedLengthEncoder.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 160 of file FixedLengthEncoder.h.
References UNREACHABLE.
|
inlineoverridevirtual |
Update statistics for encoded data without appending.
dst_data | - the data with which to update statistics |
num_elements | - the number of elements to scan in the data |
Reimplemented from Encoder.
Definition at line 125 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, Encoder::decimal_overflow_validator_, FixedLengthEncoder< T, V >::has_nulls, logger::init(), threading_serial::parallel_reduce(), and DecimalOverflowValidator::validate().
|
inlineprivate |
Definition at line 280 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, and FixedLengthEncoder< T, V >::has_nulls.
Referenced by FixedLengthEncoder< T, V >::appendEncodedOrUnencodedData().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 185 of file FixedLengthEncoder.h.
References FixedLengthEncoder< T, V >::dataMax, FixedLengthEncoder< T, V >::dataMin, FixedLengthEncoder< T, V >::has_nulls, Encoder::num_elems_, and heavydb.dtypes::T.
T FixedLengthEncoder< T, V >::dataMax |
Definition at line 222 of file FixedLengthEncoder.h.
Referenced by FixedLengthEncoder< T, V >::copyMetadata(), FixedLengthEncoder< T, V >::encodeDataAndUpdateStats(), FixedLengthEncoder< T, V >::getMetadata(), FixedLengthEncoder< T, V >::readMetadata(), FixedLengthEncoder< T, V >::reduceStats(), FixedLengthEncoder< T, V >::resetChunkStats(), FixedLengthEncoder< T, V >::updateStats(), FixedLengthEncoder< T, V >::updateStatsEncoded(), FixedLengthEncoder< T, V >::updateStatsWithAlreadyEncoded(), and FixedLengthEncoder< T, V >::writeMetadata().
T FixedLengthEncoder< T, V >::dataMin |
Definition at line 221 of file FixedLengthEncoder.h.
Referenced by FixedLengthEncoder< T, V >::copyMetadata(), FixedLengthEncoder< T, V >::encodeDataAndUpdateStats(), FixedLengthEncoder< T, V >::getMetadata(), FixedLengthEncoder< T, V >::readMetadata(), FixedLengthEncoder< T, V >::reduceStats(), FixedLengthEncoder< T, V >::resetChunkStats(), FixedLengthEncoder< T, V >::updateStats(), FixedLengthEncoder< T, V >::updateStatsEncoded(), FixedLengthEncoder< T, V >::updateStatsWithAlreadyEncoded(), and FixedLengthEncoder< T, V >::writeMetadata().
bool FixedLengthEncoder< T, V >::has_nulls |
Definition at line 223 of file FixedLengthEncoder.h.
Referenced by FixedLengthEncoder< T, V >::copyMetadata(), FixedLengthEncoder< T, V >::encodeDataAndUpdateStats(), FixedLengthEncoder< T, V >::getMetadata(), heavydb.thrift.ttypes.TColumnRange::read(), FixedLengthEncoder< T, V >::readMetadata(), FixedLengthEncoder< T, V >::reduceStats(), FixedLengthEncoder< T, V >::resetChunkStats(), FixedLengthEncoder< T, V >::updateStats(), FixedLengthEncoder< T, V >::updateStatsEncoded(), FixedLengthEncoder< T, V >::updateStatsWithAlreadyEncoded(), heavydb.thrift.ttypes.TColumnRange::write(), and FixedLengthEncoder< T, V >::writeMetadata().