18 namespace data_conversion {
22 template <
typename DataType>
23 bool is_null(
const DataType& typed_value) {
24 if constexpr (std::is_arithmetic<DataType>::value) {
25 auto null = foreign_storage::get_null_value<DataType>();
26 if (typed_value == null) {
40 const size_t num_elements,
43 std::vector<std::string_view> materialized_string_views(num_elements);
46 materialized_string_views.begin(),
47 [&string_dict](
const T& id) -> std::string_view {
49 return std::string_view(
nullptr, 0);
53 return materialized_string_views;
57 const size_t num_elements,
64 num_elements, string_dict, reinterpret_cast<const uint8_t*>(ids));
68 num_elements, string_dict, reinterpret_cast<const uint16_t*>(ids));
72 num_elements, string_dict, reinterpret_cast<const int32_t*>(ids));
97 auto num_elements = buffer->getEncoder()->getNumElems();
99 if (src_type_info.is_dict_encoded_string()) {
102 auto src_string_dictionary =
103 catalog->getMetadataForDict(dict_key.dict_id,
true)->stringDict.get();
104 CHECK(src_string_dictionary);
106 num_elements, src_string_dictionary, buffer->getMemoryPtr(), src_type_info);
107 }
else if (src_type_info.is_none_encoded_string()) {
110 for (
size_t i = 0; i < num_elements; ++i) {
112 index_buffer->getMemoryPtr(), buffer->getMemoryPtr(), i);
AbstractBuffer * getIndexBuf() const
static std::string_view getStringAtIndex(const int8_t *index_data, const int8_t *data, size_t index)
std::vector< std::string_view > get_materialized_string_views(const size_t num_elements, const StringDictionary *string_dict, const T *ids)
HOST DEVICE int get_size() const
virtual ~BaseSource()=default
std::string_view getStringView(int32_t string_id) const
const ColumnDescriptor * getColumnDesc() const
static SysCatalog & instance()
CONSTEXPR DEVICE bool is_null(const T &value)
virtual std::pair< const int8_t *, size_t > getSourceData()=0
const Chunk_NS::Chunk & input_
OUTPUT transform(INPUT const &input, FUNC const &func)
std::shared_ptr< Catalog > getCatalog(const std::string &dbName)
StringViewSource(const Chunk_NS::Chunk &input)
AbstractBuffer * getBuffer() const
std::vector< std::string_view > src_string_views_
std::pair< const int8_t *, size_t > getSourceData() override
const shared::StringDictKey & getStringDictKey() const