OmniSciDB  d2f719934e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringOpsIR.cpp File Reference
#include "CodeGenerator.h"
#include "Execute.h"
#include "../Shared/funcannotations.h"
#include "../Shared/sqldefs.h"
#include "Parser/ParserNode.h"
#include <boost/locale/conversion.hpp>
+ Include dependency graph for StringOpsIR.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{StringOpsIR.cpp}
 

Functions

RUNTIME_EXPORT uint64_t string_decode (int8_t *chunk_iter_, int64_t pos)
 
RUNTIME_EXPORT uint64_t string_decompress (const int32_t string_id, const int64_t string_dict_handle)
 
RUNTIME_EXPORT int32_t string_compress (const int64_t ptr_and_len, const int64_t string_dict_handle)
 
RUNTIME_EXPORT int32_t lower_encoded (int32_t string_id, int64_t string_dict_proxy_address)
 
std::vector< int32_t > anonymous_namespace{StringOpsIR.cpp}::get_compared_ids (const StringDictionaryProxy *dict, const SQLOps compare_operator, const std::string &pattern)
 

Function Documentation

RUNTIME_EXPORT int32_t lower_encoded ( int32_t  string_id,
int64_t  string_dict_proxy_address 
)

Definition at line 59 of file StringOpsIR.cpp.

References StringDictionaryProxy::getOrAddTransient(), StringDictionaryProxy::getString(), and to_lower().

60  {
61  StringDictionaryProxy* string_dict_proxy =
62  reinterpret_cast<StringDictionaryProxy*>(string_dict_proxy_address);
63  auto str = string_dict_proxy->getString(string_id);
64  return string_dict_proxy->getOrAddTransient(boost::locale::to_lower(str));
65 }
std::string to_lower(const std::string &str)
std::string getString(int32_t string_id) const
int32_t getOrAddTransient(const std::string &str)

+ Here is the call graph for this function:

RUNTIME_EXPORT int32_t string_compress ( const int64_t  ptr_and_len,
const int64_t  string_dict_handle 
)

Definition at line 50 of file StringOpsIR.cpp.

References extract_str_len_noinline(), extract_str_ptr_noinline(), and StringDictionaryProxy::getIdOfString().

51  {
52  std::string raw_str(reinterpret_cast<char*>(extract_str_ptr_noinline(ptr_and_len)),
53  extract_str_len_noinline(ptr_and_len));
54  auto string_dict_proxy =
55  reinterpret_cast<const StringDictionaryProxy*>(string_dict_handle);
56  return string_dict_proxy->getIdOfString(raw_str);
57 }
NEVER_INLINE int8_t * extract_str_ptr_noinline(const uint64_t str_and_len)
NEVER_INLINE int32_t extract_str_len_noinline(const uint64_t str_and_len)
int32_t getIdOfString(const std::string &str) const

+ Here is the call graph for this function:

RUNTIME_EXPORT uint64_t string_decode ( int8_t *  chunk_iter_,
int64_t  pos 
)

Definition at line 26 of file StringOpsIR.cpp.

References CHECK, ChunkIter_get_nth(), VarlenDatum::is_null, VarlenDatum::length, and VarlenDatum::pointer.

26  {
27  auto chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_);
28  VarlenDatum vd;
29  bool is_end;
30  ChunkIter_get_nth(chunk_iter, pos, false, &vd, &is_end);
31  CHECK(!is_end);
32  return vd.is_null ? 0
33  : (reinterpret_cast<uint64_t>(vd.pointer) & 0xffffffffffff) |
34  (static_cast<uint64_t>(vd.length) << 48);
35 }
bool is_null
Definition: sqltypes.h:153
DEVICE void ChunkIter_get_nth(ChunkIter *it, int n, bool uncompress, VarlenDatum *result, bool *is_end)
Definition: ChunkIter.cpp:181
int8_t * pointer
Definition: sqltypes.h:152
#define CHECK(condition)
Definition: Logger.h:211
size_t length
Definition: sqltypes.h:151

+ Here is the call graph for this function:

RUNTIME_EXPORT uint64_t string_decompress ( const int32_t  string_id,
const int64_t  string_dict_handle 
)

Definition at line 37 of file StringOpsIR.cpp.

References CHECK, StringDictionaryProxy::getStringBytes(), and NULL_INT.

38  {
39  if (string_id == NULL_INT) {
40  return 0;
41  }
42  auto string_dict_proxy =
43  reinterpret_cast<const StringDictionaryProxy*>(string_dict_handle);
44  auto string_bytes = string_dict_proxy->getStringBytes(string_id);
45  CHECK(string_bytes.first);
46  return (reinterpret_cast<uint64_t>(string_bytes.first) & 0xffffffffffff) |
47  (static_cast<uint64_t>(string_bytes.second) << 48);
48 }
std::pair< const char *, size_t > getStringBytes(int32_t string_id) const noexcept
#define NULL_INT
#define CHECK(condition)
Definition: Logger.h:211

+ Here is the call graph for this function: