OmniSciDB
a5dc49c757
|
#include "CodeGenerator.h"
#include "Execute.h"
#include "../Shared/funcannotations.h"
#include "../Shared/sqldefs.h"
#include "Parser/ParserNode.h"
#include "QueryEngine/ExpressionRewrite.h"
#include "StringOps/StringOps.h"
#include <boost/locale/conversion.hpp>
Go to the source code of this file.
Namespaces | |
anonymous_namespace{StringOpsIR.cpp} | |
Macros | |
#define | DEF_APPLY_NUMERIC_STRING_OPS(value_type, value_name) |
#define | DEF_APPLY_MULTI_INPUT_NUMERIC_STRING_OPS(value_type, value_name) |
#define | DEF_CONVERT_TO_STRING_AND_ENCODE(value_type, value_name) |
Functions | |
RUNTIME_EXPORT StringView | string_decode (int8_t *chunk_iter_, int64_t pos) |
RUNTIME_EXPORT StringView | string_decompress (const int32_t string_id, const int64_t string_dict_handle) |
RUNTIME_EXPORT int32_t | string_compress (const StringView string_view, const int64_t string_dict_handle) |
RUNTIME_EXPORT int32_t | apply_string_ops_and_encode (const char *str_ptr, const int32_t str_len, const int64_t string_ops_handle, const int64_t string_dict_handle) |
RUNTIME_EXPORT int32_t | apply_multi_input_string_ops_and_encode (const char *str1_ptr, const int32_t str1_len, const char *str2_ptr, const int32_t str2_len, const int64_t string_ops_handle, const int64_t string_dict_handle) |
RUNTIME_EXPORT int32_t | intersect_translate_string_id_to_other_dict (const int32_t string_id, const int64_t source_string_dict_handle, const int64_t dest_string_dict_handle) |
RUNTIME_EXPORT int32_t | union_translate_string_id_to_other_dict (const int32_t string_id, const int64_t source_string_dict_handle, const int64_t dest_string_dict_handle) |
int32_t | write_string_to_proxy (const std::string &str, const int64_t string_dict_handle) |
RUNTIME_EXPORT ALWAYS_INLINE int32_t | convert_to_string_and_encode_bool (const int8_t operand, const int64_t string_dict_handle) |
RUNTIME_EXPORT ALWAYS_INLINE int32_t | convert_to_string_and_encode_decimal (const int64_t operand, const int32_t precision, const int32_t scale, const int64_t string_dict_handle) |
RUNTIME_EXPORT ALWAYS_INLINE int32_t | convert_to_string_and_encode_time (const int64_t operand, const int64_t string_dict_handle) |
RUNTIME_EXPORT ALWAYS_INLINE int32_t | convert_to_string_and_encode_timestamp (const int64_t operand, const int32_t dimension, const int64_t string_dict_handle) |
RUNTIME_EXPORT ALWAYS_INLINE int32_t | convert_to_string_and_encode_date (const int64_t operand, const int64_t string_dict_handle) |
std::vector < StringOps_Namespace::StringOpInfo > | getStringOpInfos (const Analyzer::StringOper *expr) |
std::unique_ptr < StringDictionaryTranslationMgr > | translate_dict_strings (const Analyzer::StringOper *expr, const ExecutorDeviceType device_type, Executor *executor) |
void | pre_translate_string_ops (const Analyzer::StringOper *string_oper, Executor *executor) |
std::vector< int32_t > | anonymous_namespace{StringOpsIR.cpp}::get_compared_ids (const StringDictionaryProxy *dict, const SQLOps compare_operator, const std::string &pattern) |
#define DEF_APPLY_MULTI_INPUT_NUMERIC_STRING_OPS | ( | value_type, | |
value_name | |||
) |
Definition at line 148 of file StringOpsIR.cpp.
#define DEF_APPLY_NUMERIC_STRING_OPS | ( | value_type, | |
value_name | |||
) |
Definition at line 127 of file StringOpsIR.cpp.
#define DEF_CONVERT_TO_STRING_AND_ENCODE | ( | value_type, | |
value_name | |||
) |
Definition at line 177 of file StringOpsIR.cpp.
RUNTIME_EXPORT int32_t apply_multi_input_string_ops_and_encode | ( | const char * | str1_ptr, |
const int32_t | str1_len, | ||
const char * | str2_ptr, | ||
const int32_t | str2_len, | ||
const int64_t | string_ops_handle, | ||
const int64_t | string_dict_handle | ||
) |
Definition at line 77 of file StringOpsIR.cpp.
References StringDictionaryProxy::getOrAddTransient().
RUNTIME_EXPORT int32_t apply_string_ops_and_encode | ( | const char * | str_ptr, |
const int32_t | str_len, | ||
const int64_t | string_ops_handle, | ||
const int64_t | string_dict_handle | ||
) |
Definition at line 61 of file StringOpsIR.cpp.
References StringDictionaryProxy::getOrAddTransient().
RUNTIME_EXPORT ALWAYS_INLINE int32_t convert_to_string_and_encode_bool | ( | const int8_t | operand, |
const int64_t | string_dict_handle | ||
) |
Definition at line 194 of file StringOpsIR.cpp.
References write_string_to_proxy().
RUNTIME_EXPORT ALWAYS_INLINE int32_t convert_to_string_and_encode_date | ( | const int64_t | operand, |
const int64_t | string_dict_handle | ||
) |
Definition at line 231 of file StringOpsIR.cpp.
References shared::formatDate(), and write_string_to_proxy().
RUNTIME_EXPORT ALWAYS_INLINE int32_t convert_to_string_and_encode_decimal | ( | const int64_t | operand, |
const int32_t | precision, | ||
const int32_t | scale, | ||
const int64_t | string_dict_handle | ||
) |
Definition at line 200 of file StringOpsIR.cpp.
References shared::power10inv(), and write_string_to_proxy().
RUNTIME_EXPORT ALWAYS_INLINE int32_t convert_to_string_and_encode_time | ( | const int64_t | operand, |
const int64_t | string_dict_handle | ||
) |
Definition at line 212 of file StringOpsIR.cpp.
References shared::formatHMS(), and write_string_to_proxy().
RUNTIME_EXPORT ALWAYS_INLINE int32_t convert_to_string_and_encode_timestamp | ( | const int64_t | operand, |
const int32_t | dimension, | ||
const int64_t | string_dict_handle | ||
) |
Definition at line 221 of file StringOpsIR.cpp.
References shared::formatDateTime(), and write_string_to_proxy().
std::vector<StringOps_Namespace::StringOpInfo> getStringOpInfos | ( | const Analyzer::StringOper * | expr | ) |
Definition at line 277 of file StringOpsIR.cpp.
References CHECK, and Analyzer::StringOper::getChainedStringOpExprs().
Referenced by CodeGenerator::codegenPerRowStringOper(), and translate_dict_strings().
RUNTIME_EXPORT int32_t intersect_translate_string_id_to_other_dict | ( | const int32_t | string_id, |
const int64_t | source_string_dict_handle, | ||
const int64_t | dest_string_dict_handle | ||
) |
Definition at line 96 of file StringOpsIR.cpp.
References StringDictionaryProxy::getString().
void pre_translate_string_ops | ( | const Analyzer::StringOper * | string_oper, |
Executor * | executor | ||
) |
Definition at line 650 of file StringOpsIR.cpp.
References CHECK, CHECK_GT, CHECK_NE, CPU, Analyzer::Expr::get_type_info(), Analyzer::StringOper::getArg(), Analyzer::StringOper::getArity(), TRANSIENT_DICT_ID, and translate_dict_strings().
Referenced by CodeGenerator::codegenDictLike(), and CodeGenerator::codegenDictRegexp().
RUNTIME_EXPORT int32_t string_compress | ( | const StringView | string_view, |
const int64_t | string_dict_handle | ||
) |
Definition at line 50 of file StringOpsIR.cpp.
References StringDictionaryProxy::getOrAddTransient(), and StringView::stringView().
RUNTIME_EXPORT StringView string_decode | ( | int8_t * | chunk_iter_, |
int64_t | pos | ||
) |
Definition at line 28 of file StringOpsIR.cpp.
References CHECK, ChunkIter_get_nth(), VarlenDatum::is_null, VarlenDatum::length, and VarlenDatum::pointer.
RUNTIME_EXPORT StringView string_decompress | ( | const int32_t | string_id, |
const int64_t | string_dict_handle | ||
) |
Definition at line 38 of file StringOpsIR.cpp.
References CHECK, StringDictionaryProxy::getStringBytes(), and NULL_INT.
std::unique_ptr<StringDictionaryTranslationMgr> translate_dict_strings | ( | const Analyzer::StringOper * | expr, |
const ExecutorDeviceType | device_type, | ||
Executor * | executor | ||
) |
Definition at line 490 of file StringOpsIR.cpp.
References CHECK, Data_Namespace::CPU_LEVEL, Analyzer::Expr::get_type_info(), Analyzer::StringOper::getArg(), SQLTypeInfo::getStringDictKey(), getStringOpInfos(), GPU, and Data_Namespace::GPU_LEVEL.
Referenced by CodeGenerator::codegen(), and pre_translate_string_ops().
RUNTIME_EXPORT int32_t union_translate_string_id_to_other_dict | ( | const int32_t | string_id, |
const int64_t | source_string_dict_handle, | ||
const int64_t | dest_string_dict_handle | ||
) |
Definition at line 112 of file StringOpsIR.cpp.
References StringDictionaryProxy::getString().
|
inline |
Definition at line 168 of file StringOpsIR.cpp.
References StringDictionaryProxy::getOrAddTransient().
Referenced by convert_to_string_and_encode_bool(), convert_to_string_and_encode_date(), convert_to_string_and_encode_decimal(), convert_to_string_and_encode_time(), and convert_to_string_and_encode_timestamp().