OmniSciDB
a5dc49c757
|
#include <StringNoneEncoder.h>
Public Member Functions | |
StringNoneEncoder (AbstractBuffer *buffer) | |
size_t | getNumElemsForBytesInsertData (const std::vector< std::string > *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 |
template<typename StringType > | |
std::shared_ptr< ChunkMetadata > | appendData (const StringType *srcData, const int start_idx, const size_t numAppendElems, const bool replicating=false) |
template<typename StringType > | |
std::shared_ptr< ChunkMetadata > | appendData (const std::vector< StringType > *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 | 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 |
void | setIndexBuffer (AbstractBuffer *buf) |
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 std::string_view | getStringAtIndex (const int8_t *index_data, const int8_t *data, size_t index) |
Static Public Member Functions inherited from Encoder | |
static Encoder * | Create (Data_Namespace::AbstractBuffer *buffer, const SQLTypeInfo sqlType) |
Private Member Functions | |
template<typename StringType > | |
void | update_elem_stats (const StringType &elem) |
Static Private Member Functions | |
static std::pair < StringOffsetT, StringOffsetT > | getStringOffsets (const int8_t *index_data, size_t index) |
static size_t | getStringSizeAtIndex (const int8_t *index_data, size_t index) |
Private Attributes | |
AbstractBuffer * | index_buf |
StringOffsetT | last_offset |
bool | has_nulls |
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 36 of file StringNoneEncoder.h.
|
inline |
Definition at line 38 of file StringNoneEncoder.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 51 of file StringNoneEncoder.h.
References UNREACHABLE.
Referenced by foreign_storage::GeospatialEncoder::appendBaseDataAndUpdateMetadata(), appendData(), Chunk_NS::Chunk::appendData(), appendEncodedData(), appendEncodedDataAtIndices(), and data_conversion::StringViewToStringNoneEncoder::encodeAndAppendData().
std::shared_ptr< ChunkMetadata > StringNoneEncoder::appendData | ( | const StringType * | srcData, |
const int | start_idx, | ||
const size_t | numAppendElems, | ||
const bool | replicating = false |
||
) |
Definition at line 102 of file StringNoneEncoder.cpp.
References Data_Namespace::AbstractBuffer::append(), Encoder::buffer_, CHECK, CHECK_GE, gpu_enabled::copy(), Data_Namespace::CPU_LEVEL, run_benchmark_import::dest, getMetadata(), index_buf, 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().
std::shared_ptr< ChunkMetadata > StringNoneEncoder::appendData | ( | const std::vector< StringType > * | srcData, |
const int | start_idx, | ||
const size_t | numAppendElems, | ||
const bool | replicating = false |
||
) |
Definition at line 93 of file StringNoneEncoder.cpp.
References appendData().
|
overridevirtual |
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 78 of file StringNoneEncoder.cpp.
References appendData(), and getStringAtIndex().
|
overridevirtual |
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 66 of file StringNoneEncoder.cpp.
References appendData(), and getStringAtIndex().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 119 of file StringNoneEncoder.h.
References Encoder::getNumElems(), has_nulls, and Encoder::num_elems_.
|
inline |
|
overridevirtual |
Reimplemented from Encoder.
Definition at line 262 of file StringNoneEncoder.cpp.
References Encoder::getMetadata(), and has_nulls.
Referenced by appendData().
|
overridevirtual |
Implements Encoder.
Definition at line 270 of file StringNoneEncoder.cpp.
References has_nulls, ChunkStats::min, and Datum::stringval.
|
overridevirtual |
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 49 of file StringNoneEncoder.cpp.
References getStringSizeAtIndex().
size_t StringNoneEncoder::getNumElemsForBytesInsertData | ( | const std::vector< std::string > * | srcData, |
const int | start_idx, | ||
const size_t | numAppendElems, | ||
const size_t | byteLimit, | ||
const bool | replicating = false |
||
) |
Definition at line 31 of file StringNoneEncoder.cpp.
References anonymous_namespace{Utm.h}::n.
Referenced by Chunk_NS::Chunk::getNumElemsForBytesInsertData().
|
static |
Definition at line 225 of file StringNoneEncoder.cpp.
References getStringOffsets(), and last_offset.
Referenced by appendEncodedData(), appendEncodedDataAtIndices(), and data_conversion::StringViewSource::getSourceData().
|
staticprivate |
Definition at line 207 of file StringNoneEncoder.cpp.
References CHECK, and last_offset.
Referenced by getStringAtIndex(), and getStringSizeAtIndex().
|
staticprivate |
Definition at line 219 of file StringNoneEncoder.cpp.
References getStringOffsets(), and last_offset.
Referenced by getNumElemsForBytesEncodedDataAtIndices().
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 113 of file StringNoneEncoder.h.
References CHECK_NE, has_nulls, 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 127 of file StringNoneEncoder.h.
References ChunkStats::has_nulls, and has_nulls.
|
inlineoverridevirtual |
Resets chunk metadata stats to their default values.
Implements Encoder.
Definition at line 135 of file StringNoneEncoder.h.
References has_nulls.
|
inline |
Definition at line 125 of file StringNoneEncoder.h.
References index_buf.
Referenced by Chunk_NS::Chunk::initEncoder().
|
private |
Definition at line 201 of file StringNoneEncoder.cpp.
References has_nulls.
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 91 of file StringNoneEncoder.h.
References UNREACHABLE.
|
overridevirtual |
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 189 of file StringNoneEncoder.cpp.
References has_nulls, anonymous_namespace{Utm.h}::n, and update_elem_stats().
|
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 99 of file StringNoneEncoder.h.
References UNREACHABLE.
|
inlineoverridevirtual |
Implements Encoder.
Definition at line 107 of file StringNoneEncoder.h.
References has_nulls, and Encoder::num_elems_.
|
private |
Definition at line 150 of file StringNoneEncoder.h.
Referenced by copyMetadata(), getMetadata(), heavydb.thrift.ttypes.TColumnRange::read(), readMetadata(), resetChunkStats(), update_elem_stats(), updateStats(), heavydb.thrift.ttypes.TColumnRange::write(), and writeMetadata().
|
private |
Definition at line 148 of file StringNoneEncoder.h.
Referenced by appendData(), getIndexBuf(), and setIndexBuffer().
|
private |
Definition at line 149 of file StringNoneEncoder.h.
Referenced by appendData(), getStringAtIndex(), getStringOffsets(), and getStringSizeAtIndex().