22 namespace data_conversion {
24 template <
typename IdType>
28 const bool error_tracking_enabled)
34 auto typed_data =
reinterpret_cast<const std::string_view*
>(data);
37 <<
" unimplemented case for this encoder";
39 std::vector<std::string_view> input_buffer(typed_data, typed_data + num_elements);
42 for (
size_t i = 0; i < num_elements; ++i) {
45 throw std::runtime_error(
"String length of " +
47 " exceeds allowed maximum string length of " +
56 throw std::runtime_error(
"NULL value not allowed in NOT NULL column");
74 for (
size_t i = 0; i < num_elements; ++i) {
82 num_elements *
sizeof(IdType));
100 type_info.getStringDictKey().db_id);
101 string_dict_ = catalog->getMetadataForDict(type_info.getStringDictKey().dict_id,
true)
std::vector< IdType > dict_encoding_output_buffer_
void updateMetadataStats(const DataType &typed_value, const bool is_date_in_days=false)
std::optional< std::vector< bool > > & getDeleteBuffer()
const ColumnDescriptor * getColumnDesc() const
static SysCatalog & instance()
StringViewToStringDictEncoder(const Chunk_NS::Chunk &dst_chunk, const bool error_tracking_enabled)
StringDictionary * string_dict_
An AbstractBuffer is a unit of data management for a data manager.
bool isNull(const DataType &typed_value)
std::optional< std::vector< bool > > delete_buffer_
void getOrAddBulk(const std::vector< String > &string_vec, T *encoded_vec)
void encodeAndAppendData(const int8_t *data, const size_t num_elements) override
std::shared_ptr< Catalog > getCatalog(const std::string &dbName)
AbstractBuffer * getBuffer() const
virtual void append(int8_t *src, const size_t num_bytes, const MemoryLevel src_buffer_type=CPU_LEVEL, const int device_id=-1)=0
const Chunk_NS::Chunk & dst_chunk_
static constexpr size_t MAX_STRLEN
HOST DEVICE bool get_notnull() const
const bool error_tracking_enabled_
const Chunk_NS::Chunk & getDstChunk() const
SQLTypeInfo dst_type_info_