OmniSciDB
a5dc49c757
|
#include <FixedLengthArrayNoneEncoder.h>
Public Member Functions | |
FixedLengthArrayNoneEncoder (AbstractBuffer *buffer, size_t as) | |
size_t | getNumElemsForBytesEncodedDataAtIndices (const int8_t *index_data, const std::vector< size_t > &selected_idx, const size_t byte_limit) override |
size_t | getNumElemsForBytesInsertData (const std::vector< ArrayDatum > *srcData, const int start_idx, const size_t numAppendElems, const size_t byteLimit, const bool replicating=false) |
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 (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 > | appendData (const std::vector< ArrayDatum > *srcData, const int start_idx, const size_t numAppendElems, const bool replicating=false) |
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 | reduceStats (const Encoder &) 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 | writeMetadata (FILE *f) override |
void | readMetadata (FILE *f) override |
void | copyMetadata (const Encoder *copyFromEncoder) override |
void | updateMetadata (int8_t *array) |
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 () |
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) |
Static Public Member Functions | |
static bool | is_null_ignore_not_null (const SQLTypeInfo &type, int8_t *array) |
static bool | is_null (const SQLTypeInfo &type, int8_t *array) |
Static Public Member Functions inherited from Encoder | |
static Encoder * | Create (Data_Namespace::AbstractBuffer *buffer, const SQLTypeInfo sqlType) |
Public Attributes | |
Datum | elem_min |
Datum | elem_max |
bool | has_nulls |
bool | initialized |
Private Member Functions | |
bool | is_null (int8_t *array) |
bool | is_null_ignore_not_null (int8_t *array) |
void | update_elem_stats (const ArrayDatum &array) |
Private Attributes | |
std::mutex | EncoderMutex_ |
std::mutex | print_mutex_ |
size_t | array_size |
Additional Inherited Members | |
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 40 of file FixedLengthArrayNoneEncoder.h.
|
inline |
Definition at line 42 of file FixedLengthArrayNoneEncoder.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 97 of file FixedLengthArrayNoneEncoder.h.
References UNREACHABLE.
Referenced by Chunk_NS::Chunk::appendData(), appendEncodedData(), and appendEncodedDataAtIndices().
|
inline |
Definition at line 106 of file FixedLengthArrayNoneEncoder.h.
References Data_Namespace::AbstractBuffer::append(), array_size, Encoder::buffer_, CHECK_EQ, getMetadata(), Data_Namespace::AbstractBuffer::isDirty(), Encoder::num_elems_, Data_Namespace::AbstractBuffer::reserve(), Data_Namespace::AbstractBuffer::setDirty(), and updateStats().
|
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 83 of file FixedLengthArrayNoneEncoder.h.
References appendData(), and array_size.
|
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 67 of file FixedLengthArrayNoneEncoder.h.
References appendData(), array_size, and is_null_ignore_not_null().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 217 of file FixedLengthArrayNoneEncoder.h.
References elem_max, elem_min, Encoder::getNumElems(), has_nulls, initialized, and Encoder::num_elems_.
|
inlineoverridevirtual |
Reimplemented from Encoder.
Definition at line 163 of file FixedLengthArrayNoneEncoder.h.
References elem_max, elem_min, Encoder::getMetadata(), and has_nulls.
Referenced by appendData().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 169 of file FixedLengthArrayNoneEncoder.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 45 of file FixedLengthArrayNoneEncoder.h.
References array_size.
|
inline |
Definition at line 55 of file FixedLengthArrayNoneEncoder.h.
References array_size.
Referenced by Chunk_NS::Chunk::getNumElemsForBytesInsertData().
|
inlinestatic |
Definition at line 281 of file FixedLengthArrayNoneEncoder.h.
References SQLTypeInfo::get_notnull(), and is_null_ignore_not_null().
Referenced by Fragmenter_Namespace::FixedLenArrayChunkConverter::convertToColumnarFormat(), and updateMetadata().
|
inlineprivate |
Definition at line 315 of file FixedLengthArrayNoneEncoder.h.
References Encoder::buffer_, Data_Namespace::AbstractBuffer::getSqlType(), and is_null().
Referenced by is_null().
|
inlinestatic |
Definition at line 231 of file FixedLengthArrayNoneEncoder.h.
References CHECK_EQ, SQLTypeInfo::get_compression(), SQLTypeInfo::get_subtype(), kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kENCODING_DICT, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, NULL_ARRAY_BIGINT, NULL_ARRAY_BOOLEAN, NULL_ARRAY_DOUBLE, NULL_ARRAY_FLOAT, NULL_ARRAY_INT, NULL_ARRAY_SMALLINT, NULL_ARRAY_TINYINT, and UNREACHABLE.
Referenced by appendEncodedDataAtIndices(), is_null(), and is_null_ignore_not_null().
|
inlineprivate |
Definition at line 317 of file FixedLengthArrayNoneEncoder.h.
References Encoder::buffer_, Data_Namespace::AbstractBuffer::getSqlType(), and is_null_ignore_not_null().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 208 of file FixedLengthArrayNoneEncoder.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 288 of file FixedLengthArrayNoneEncoder.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 300 of file FixedLengthArrayNoneEncoder.h.
References has_nulls, and initialized.
|
inlineprivate |
Definition at line 321 of file FixedLengthArrayNoneEncoder.h.
References Datum::bigintval, Datum::boolval, Encoder::buffer_, CHECK_EQ, Encoder::decimal_overflow_validator_, 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, UNREACHABLE, and DecimalOverflowValidator::validate().
Referenced by updateMetadata(), and updateStats().
|
inline |
Definition at line 227 of file FixedLengthArrayNoneEncoder.h.
References array_size, is_null(), and update_elem_stats().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 175 of file FixedLengthArrayNoneEncoder.h.
References CHECK.
Referenced by appendData().
|
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 181 of file FixedLengthArrayNoneEncoder.h.
References UNREACHABLE.
|
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 185 of file FixedLengthArrayNoneEncoder.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 191 of file FixedLengthArrayNoneEncoder.h.
References anonymous_namespace{Utm.h}::n, and update_elem_stats().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 199 of file FixedLengthArrayNoneEncoder.h.
References elem_max, elem_min, has_nulls, initialized, and Encoder::num_elems_.
|
private |
Definition at line 313 of file FixedLengthArrayNoneEncoder.h.
Referenced by appendData(), appendEncodedData(), appendEncodedDataAtIndices(), getNumElemsForBytesEncodedDataAtIndices(), getNumElemsForBytesInsertData(), and updateMetadata().
Datum FixedLengthArrayNoneEncoder::elem_max |
Definition at line 306 of file FixedLengthArrayNoneEncoder.h.
Referenced by copyMetadata(), getMetadata(), readMetadata(), resetChunkStats(), update_elem_stats(), and writeMetadata().
Datum FixedLengthArrayNoneEncoder::elem_min |
Definition at line 305 of file FixedLengthArrayNoneEncoder.h.
Referenced by copyMetadata(), getMetadata(), readMetadata(), resetChunkStats(), update_elem_stats(), and writeMetadata().
|
private |
Definition at line 311 of file FixedLengthArrayNoneEncoder.h.
bool FixedLengthArrayNoneEncoder::has_nulls |
Definition at line 307 of file FixedLengthArrayNoneEncoder.h.
Referenced by copyMetadata(), getMetadata(), heavydb.thrift.ttypes.TColumnRange::read(), readMetadata(), resetChunkStats(), update_elem_stats(), heavydb.thrift.ttypes.TColumnRange::write(), and writeMetadata().
bool FixedLengthArrayNoneEncoder::initialized |
Definition at line 308 of file FixedLengthArrayNoneEncoder.h.
Referenced by copyMetadata(), readMetadata(), resetChunkStats(), update_elem_stats(), and writeMetadata().
|
private |
Definition at line 312 of file FixedLengthArrayNoneEncoder.h.