OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Column< TextEncodingDict > Struct Template Reference

#include <heavydbTypes.h>

+ Collaboration diagram for Column< TextEncodingDict >:

Public Member Functions

DEVICE Column (const Column &other)
 
DEVICE Column (TextEncodingDict *ptr, const int64_t num_rows, StringDictionaryProxy *string_dict_proxy)
 
DEVICE Column (std::vector< TextEncodingDict > &input_vec)
 
DEVICE TextEncodingDictoperator[] (const unsigned int index) const
 
DEVICE TextEncodingDictgetPtr () const
 
DEVICE int64_t size () const
 
DEVICE void setSize (int64_t num_rows)
 
DEVICE bool isNull (int64_t index) const
 
DEVICE void setNull (int64_t index)
 
DEVICE int32_t getDictDbId () const
 
DEVICE int32_t getDictId () const
 
DEVICE const std::string getString (int64_t index) const
 
DEVICE const char * getCString (int64_t index) const
 
DEVICE const TextEncodingDict getOrAddTransient (const std::string &str)
 
DEVICE Column< TextEncodingDict > & operator= (const Column< TextEncodingDict > &other)
 

Public Attributes

TextEncodingDictptr_
 
int64_t num_rows_
 
StringDictionaryProxystring_dict_proxy_
 

Detailed Description

template<>
struct Column< TextEncodingDict >

Definition at line 910 of file heavydbTypes.h.

Constructor & Destructor Documentation

DEVICE Column< TextEncodingDict >::Column ( const Column< TextEncodingDict > &  other)
inline

Definition at line 916 of file heavydbTypes.h.

917  : ptr_(other.ptr_)
918  , num_rows_(other.num_rows_)
919  , string_dict_proxy_(other.string_dict_proxy_) {}
T * ptr_
Definition: heavydbTypes.h:725
StringDictionaryProxy * string_dict_proxy_
Definition: heavydbTypes.h:915
int64_t num_rows_
Definition: heavydbTypes.h:726
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911
DEVICE Column< TextEncodingDict >::Column ( TextEncodingDict ptr,
const int64_t  num_rows,
StringDictionaryProxy string_dict_proxy 
)
inline

Definition at line 920 of file heavydbTypes.h.

923  : ptr_(ptr), num_rows_(num_rows), string_dict_proxy_(string_dict_proxy) {}
StringDictionaryProxy * string_dict_proxy_
Definition: heavydbTypes.h:915
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911
DEVICE Column< TextEncodingDict >::Column ( std::vector< TextEncodingDict > &  input_vec)
inline

Definition at line 924 of file heavydbTypes.h.

925  : ptr_(input_vec.data())
926  , num_rows_(static_cast<int64_t>(input_vec.size()))
927  , string_dict_proxy_(nullptr) {}
StringDictionaryProxy * string_dict_proxy_
Definition: heavydbTypes.h:915
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911

Member Function Documentation

DEVICE const char* Column< TextEncodingDict >::getCString ( int64_t  index) const
inline

Definition at line 968 of file heavydbTypes.h.

References Column< T >::isNull(), and Column< T >::ptr_.

968  {
969  if (isNull(index)) {
970  return nullptr;
971  }
972  auto [c_str, len] = string_dict_proxy_->getStringBytes(ptr_[index].value);
973  return c_str;
974  }
std::pair< const char *, size_t > getStringBytes(int32_t string_id) const noexcept
StringDictionaryProxy * string_dict_proxy_
Definition: heavydbTypes.h:915
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911
DEVICE bool isNull(int64_t index) const
Definition: heavydbTypes.h:953

+ Here is the call graph for this function:

DEVICE int32_t Column< TextEncodingDict >::getDictDbId ( ) const
inline

Definition at line 959 of file heavydbTypes.h.

959  {
961  }
StringDictionaryProxy * string_dict_proxy_
Definition: heavydbTypes.h:915
const shared::StringDictKey & getDictKey() const noexcept
DEVICE int32_t Column< TextEncodingDict >::getDictId ( ) const
inline

Definition at line 962 of file heavydbTypes.h.

962  {
964  }
StringDictionaryProxy * string_dict_proxy_
Definition: heavydbTypes.h:915
const shared::StringDictKey & getDictKey() const noexcept
DEVICE const TextEncodingDict Column< TextEncodingDict >::getOrAddTransient ( const std::string &  str)
inline

Definition at line 975 of file heavydbTypes.h.

Referenced by ct_string_concat__cpu_(), ct_substr__cpu_(), and ct_synthesize_new_dict__cpu_().

975  {
977  }
StringDictionaryProxy * string_dict_proxy_
Definition: heavydbTypes.h:915
int32_t getOrAddTransient(const std::string &)

+ Here is the caller graph for this function:

DEVICE TextEncodingDict* Column< TextEncodingDict >::getPtr ( ) const
inline

Definition at line 949 of file heavydbTypes.h.

References Column< T >::ptr_.

Referenced by get_column_metadata(), and get_column_min_max().

949 { return ptr_; }
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911

+ Here is the caller graph for this function:

DEVICE const std::string Column< TextEncodingDict >::getString ( int64_t  index) const
inline

Definition at line 965 of file heavydbTypes.h.

References Column< T >::isNull(), and Column< T >::ptr_.

Referenced by ct_binding_str_length__cpu_(), and ct_substr__cpu_().

965  {
966  return isNull(index) ? "" : string_dict_proxy_->getString(ptr_[index].value);
967  }
std::string getString(int32_t string_id) const
StringDictionaryProxy * string_dict_proxy_
Definition: heavydbTypes.h:915
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911
DEVICE bool isNull(int64_t index) const
Definition: heavydbTypes.h:953

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE bool Column< TextEncodingDict >::isNull ( int64_t  index) const
inline

Definition at line 953 of file heavydbTypes.h.

References is_null(), and Column< T >::ptr_.

953 { return is_null(ptr_[index].value); }
CONSTEXPR DEVICE bool is_null(const T &value)
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911

+ Here is the call graph for this function:

DEVICE Column<TextEncodingDict>& Column< TextEncodingDict >::operator= ( const Column< TextEncodingDict > &  other)
inline

Definition at line 981 of file heavydbTypes.h.

References Column< T >::ptr_, ptr_, Column< T >::size(), size(), and TextEncodingDict.

981  {
982 #ifndef __CUDACC__
983  if (size() == other.size()) {
984  memcpy(ptr_, other.ptr_, other.size() * sizeof(TextEncodingDict));
985  } else {
986  throw std::runtime_error("cannot copy assign columns with different sizes");
987  }
988 #else
989  if (size() == other.size()) {
990  for (unsigned int i = 0; i < size(); i++) {
991  ptr_[i] = other[i];
992  }
993  } else {
994  // TODO: set error
995  }
996 #endif
997  return *this;
998  }
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911
DEVICE int64_t size() const
Definition: heavydbTypes.h:950

+ Here is the call graph for this function:

DEVICE TextEncodingDict& Column< TextEncodingDict >::operator[] ( const unsigned int  index) const
inline

Definition at line 937 of file heavydbTypes.h.

References DEVICE, Column< T >::num_rows_, Column< T >::ptr_, and set_null().

937  {
938  if (index >= num_rows_) {
939 #ifndef __CUDACC__
940  throw std::runtime_error("column buffer index is out of range");
941 #else
942  static DEVICE TextEncodingDict null_value;
943  set_null(null_value.value);
944  return null_value;
945 #endif
946  }
947  return ptr_[index];
948  }
#define DEVICE
CONSTEXPR DEVICE void set_null(T &value)
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911

+ Here is the call graph for this function:

DEVICE void Column< TextEncodingDict >::setNull ( int64_t  index)
inline

Definition at line 955 of file heavydbTypes.h.

References Column< T >::ptr_, and set_null().

Referenced by ct_binding_str_equals__cpu_(), and ct_string_concat__cpu_().

955 { set_null(ptr_[index].value); }
CONSTEXPR DEVICE void set_null(T &value)
TextEncodingDict * ptr_
Definition: heavydbTypes.h:911

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE void Column< TextEncodingDict >::setSize ( int64_t  num_rows)
inline

Definition at line 951 of file heavydbTypes.h.

References Column< T >::num_rows_.

951 { num_rows_ = num_rows; }
DEVICE int64_t Column< TextEncodingDict >::size ( ) const
inline

Definition at line 950 of file heavydbTypes.h.

References Column< T >::num_rows_.

Referenced by ct_binding_dict_encoded1__cpu_1(), ct_binding_dict_encoded2__cpu_1(), ct_binding_dict_encoded3__cpu_1(), ct_binding_str_length__cpu_(), ct_substr__cpu_(), get_column_metadata(), get_column_min_max(), operator=(), and row_copier_text().

950 { return num_rows_; }

+ Here is the caller graph for this function:

Member Data Documentation

int64_t Column< TextEncodingDict >::num_rows_

Definition at line 912 of file heavydbTypes.h.

Definition at line 911 of file heavydbTypes.h.

Referenced by operator=().

Definition at line 915 of file heavydbTypes.h.

Referenced by populate_output_stats_cols(), and supported_ml_frameworks__cpu_().


The documentation for this struct was generated from the following file: