23 #ifndef STRING_NONE_ENCODER_H
24 #define STRING_NONE_ENCODER_H
43 const size_t numAppendElems,
44 const size_t byteLimit,
45 const bool replicating =
false);
48 const std::vector<size_t>& selected_idx,
49 const size_t byte_limit)
override;
51 std::shared_ptr<ChunkMetadata>
appendData(int8_t*& src_data,
52 const size_t num_elems_to_append,
54 const bool replicating =
false,
55 const int64_t offset = -1)
override {
61 const int8_t* index_data,
63 const std::vector<size_t>& selected_idx)
override;
67 const size_t start_idx,
68 const size_t num_elements)
override;
70 template <
typename StringType>
71 std::shared_ptr<ChunkMetadata>
appendData(
const StringType* srcData,
73 const size_t numAppendElems,
74 const bool replicating =
false);
76 template <
typename StringType>
77 std::shared_ptr<ChunkMetadata>
appendData(
const std::vector<StringType>* srcData,
79 const size_t numAppendElems,
80 const bool replicating =
false);
82 void getMetadata(
const std::shared_ptr<ChunkMetadata>& chunkMetadata)
override;
91 void updateStats(
const int8_t*
const src_data,
const size_t num_elements)
override {
95 void updateStats(
const std::vector<std::string>*
const src_data,
96 const size_t start_idx,
97 const size_t num_elements)
override;
99 void updateStats(
const std::vector<ArrayDatum>*
const src_data,
100 const size_t start_idx,
101 const size_t num_elements)
override {
109 fwrite((int8_t*)&
num_elems_,
sizeof(
size_t), 1, f);
110 fwrite((int8_t*)&
has_nulls,
sizeof(
bool), 1, f);
143 const int8_t* index_data,
152 template <
typename StringType>
157 #endif // STRING_NONE_ENCODER_H
static std::string_view getStringAtIndex(const int8_t *index_data, const int8_t *data, size_t index)
void copyMetadata(const Encoder *copyFromEncoder) override
void updateStats(const int64_t, const bool) override
void resetChunkStats() override
void writeMetadata(FILE *f) 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
bool resetChunkStats(const ChunkStats &stats) override
: Reset chunk level stats (min, max, nulls) using new values from the argument.
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)
AbstractBuffer * index_buf
size_t getNumElemsForBytesEncodedDataAtIndices(const int8_t *index_data, const std::vector< size_t > &selected_idx, const size_t byte_limit) override
void reduceStats(const Encoder &) override
size_t getNumElems() const
StringNoneEncoder(AbstractBuffer *buffer)
An AbstractBuffer is a unit of data management for a data manager.
static size_t getStringSizeAtIndex(const int8_t *index_data, size_t index)
void update_elem_stats(const StringType &elem)
StringOffsetT last_offset
void getMetadata(const std::shared_ptr< ChunkMetadata > &chunkMetadata) override
void updateStats(const int8_t *const src_data, const size_t num_elements) 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
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)
AbstractBuffer * getIndexBuf() const
void updateStats(const std::vector< ArrayDatum > *const src_data, const size_t start_idx, const size_t num_elements) override
bool g_enable_watchdog false
void setIndexBuffer(AbstractBuffer *buf)
void readMetadata(FILE *f) override
static std::pair< StringOffsetT, StringOffsetT > getStringOffsets(const int8_t *index_data, size_t index)
void updateStats(const double, const bool) override