Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit e176743

Browse files
committed
Remove StringDictionaryProxy class.
Signed-off-by: ienkovich <[email protected]>
1 parent 1cb5852 commit e176743

34 files changed

+105
-959
lines changed

omniscidb/Analyzer/Analyzer.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,9 @@ bool exprs_share_one_and_same_rte_idx(const hdk::ir::ExprPtr& lhs_expr,
490490
return collector.result().size() == 1ULL;
491491
}
492492

493-
const hdk::ir::Type* get_str_dict_cast_type(
494-
const hdk::ir::Type* lhs_type,
495-
const hdk::ir::Type* rhs_type,
496-
const StringDictionaryProxyProvider* executor) {
493+
const hdk::ir::Type* get_str_dict_cast_type(const hdk::ir::Type* lhs_type,
494+
const hdk::ir::Type* rhs_type,
495+
const StringDictionaryProvider* executor) {
497496
CHECK(lhs_type->isExtDictionary());
498497
CHECK(rhs_type->isExtDictionary());
499498
const auto lhs_dict_id = lhs_type->as<hdk::ir::ExtDictionaryType>()->dictId();
@@ -512,14 +511,14 @@ const hdk::ir::Type* get_str_dict_cast_type(
512511
}
513512
// If here then neither lhs or rhs type was transient, we should see which
514513
// type has the largest dictionary and make that the destination type
515-
const auto lhs_sdp = executor->getStringDictionaryProxy(lhs_dict_id, true);
516-
const auto rhs_sdp = executor->getStringDictionaryProxy(rhs_dict_id, true);
514+
const auto lhs_sdp = executor->getStringDictionary(lhs_dict_id, true);
515+
const auto rhs_sdp = executor->getStringDictionary(rhs_dict_id, true);
517516
return lhs_sdp->entryCount() >= rhs_sdp->entryCount() ? lhs_type : rhs_type;
518517
}
519518

520519
const hdk::ir::Type* common_string_type(const hdk::ir::Type* type1,
521520
const hdk::ir::Type* type2,
522-
const StringDictionaryProxyProvider* executor) {
521+
const StringDictionaryProvider* executor) {
523522
auto& ctx = type1->ctx();
524523
const hdk::ir::Type* common_type;
525524
auto nullable = type1->nullable() || type2->nullable();
@@ -550,7 +549,7 @@ hdk::ir::ExprPtr normalizeOperExpr(const hdk::ir::OpType optype,
550549
hdk::ir::Qualifier qual,
551550
hdk::ir::ExprPtr left_expr,
552551
hdk::ir::ExprPtr right_expr,
553-
const StringDictionaryProxyProvider* executor) {
552+
const StringDictionaryProvider* executor) {
554553
if ((left_expr->type()->isDate() &&
555554
left_expr->type()->as<hdk::ir::DateType>()->unit() == hdk::ir::TimeUnit::kDay) ||
556555
(right_expr->type()->isDate() &&
@@ -669,7 +668,7 @@ hdk::ir::ExprPtr normalizeOperExpr(const hdk::ir::OpType optype,
669668
hdk::ir::ExprPtr normalizeCaseExpr(
670669
const std::list<std::pair<hdk::ir::ExprPtr, hdk::ir::ExprPtr>>& expr_pair_list,
671670
const hdk::ir::ExprPtr else_e_in,
672-
const StringDictionaryProxyProvider* executor) {
671+
const StringDictionaryProvider* executor) {
673672
std::list<std::pair<hdk::ir::ExprPtr, hdk::ir::ExprPtr>> cast_expr_pair_list =
674673
expr_pair_list;
675674
const hdk::ir::Type* type = nullptr;

omniscidb/Analyzer/Analyzer.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "SchemaMgr/ColumnInfo.h"
2828
#include "Shared/sqldefs.h"
2929
#include "Shared/sqltypes.h"
30-
#include "StringDictionary/StringDictionaryProxy.h"
30+
#include "StringDictionary/StringDictionary.h"
3131

3232
#include <cstdint>
3333
#include <iostream>
@@ -54,17 +54,16 @@ hdk::ir::ExprPtr analyzeFixedPtValue(const int64_t numericval,
5454

5555
hdk::ir::ExprPtr analyzeStringValue(const std::string& stringval);
5656

57-
hdk::ir::ExprPtr normalizeOperExpr(
58-
hdk::ir::OpType optype,
59-
hdk::ir::Qualifier qual,
60-
hdk::ir::ExprPtr left_expr,
61-
hdk::ir::ExprPtr right_expr,
62-
const StringDictionaryProxyProvider* executor = nullptr);
57+
hdk::ir::ExprPtr normalizeOperExpr(hdk::ir::OpType optype,
58+
hdk::ir::Qualifier qual,
59+
hdk::ir::ExprPtr left_expr,
60+
hdk::ir::ExprPtr right_expr,
61+
const StringDictionaryProvider* executor = nullptr);
6362

6463
hdk::ir::ExprPtr normalizeCaseExpr(
6564
const std::list<std::pair<hdk::ir::ExprPtr, hdk::ir::ExprPtr>>&,
6665
const hdk::ir::ExprPtr,
67-
const StringDictionaryProxyProvider* executor = nullptr);
66+
const StringDictionaryProvider* executor = nullptr);
6867

6968
hdk::ir::ExprPtr getLikeExpr(hdk::ir::ExprPtr arg_expr,
7069
hdk::ir::ExprPtr like_expr,

omniscidb/QueryEngine/Execute.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ size_t Executor::getArenaBlockSize() {
444444
return g_is_test_env ? 100000000 : (1UL << 32) + kArenaBlockOverhead;
445445
}
446446

447-
StringDictionaryProxy* Executor::getStringDictionaryProxy(
447+
StringDictionary* Executor::getStringDictionaryProxy(
448448
const int dict_id_in,
449449
std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner,
450450
const bool with_generation) const {
@@ -474,8 +474,8 @@ const std::vector<int32_t>* Executor::getStringProxyTranslationMap(
474474
}
475475

476476
const std::vector<int32_t>* Executor::getIntersectionStringProxyTranslationMap(
477-
const StringDictionaryProxy* source_proxy,
478-
const StringDictionaryProxy* dest_proxy,
477+
const StringDictionary* source_proxy,
478+
const StringDictionary* dest_proxy,
479479
std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner) const {
480480
CHECK(row_set_mem_owner);
481481
std::lock_guard<std::mutex> lock(

omniscidb/QueryEngine/Execute.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
#include "Shared/toString.h"
7878
#include "StringDictionary/LruCache.hpp"
7979
#include "StringDictionary/StringDictionary.h"
80-
#include "StringDictionary/StringDictionaryProxy.h"
8180

8281
#include "CostModel/CostModel.h"
8382

@@ -227,7 +226,7 @@ struct StreamExecutionContext {
227226
: ra_exe_unit(ra_exe_unit), co(co), eo(eo) {}
228227
};
229228

230-
class Executor : public StringDictionaryProxyProvider {
229+
class Executor : public StringDictionaryProvider {
231230
static_assert(sizeof(float) == 4 && sizeof(double) == 8,
232231
"Host hardware not supported, unexpected size of float / double.");
233232
static_assert(sizeof(time_t) == 8,
@@ -292,14 +291,13 @@ class Executor : public StringDictionaryProxyProvider {
292291
/**
293292
* Returns a string dictionary proxy using the currently active row set memory owner.
294293
*/
295-
virtual StringDictionaryProxy* getStringDictionaryProxy(
296-
const int dict_id,
297-
const bool with_generation) const {
294+
virtual StringDictionary* getStringDictionary(const int dict_id,
295+
const bool with_generation) const {
298296
CHECK(row_set_mem_owner_);
299297
return getStringDictionaryProxy(dict_id, row_set_mem_owner_, with_generation);
300298
}
301299

302-
StringDictionaryProxy* getStringDictionaryProxy(
300+
StringDictionary* getStringDictionaryProxy(
303301
const int dictId,
304302
const std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner,
305303
const bool with_generation) const;
@@ -312,8 +310,8 @@ class Executor : public StringDictionaryProxyProvider {
312310
const bool with_generation) const;
313311

314312
const std::vector<int32_t>* getIntersectionStringProxyTranslationMap(
315-
const StringDictionaryProxy* source_proxy,
316-
const StringDictionaryProxy* dest_proxy,
313+
const StringDictionary* source_proxy,
314+
const StringDictionary* dest_proxy,
317315
std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner) const;
318316

319317
bool isCPUOnly() const;

omniscidb/QueryEngine/ExternalExecutor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ struct DecodedString {
153153
template <class T>
154154
DecodedString decode_string(const int8_t* column,
155155
const size_t cursor,
156-
StringDictionaryProxy* sdp) {
156+
StringDictionary* sdp) {
157157
const auto ids_column = reinterpret_cast<const T*>(column);
158158
const auto val = ids_column[cursor];
159159
DecodedString result{};

omniscidb/QueryEngine/JoinHashTable/HashJoin.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,23 +307,24 @@ std::shared_ptr<HashJoin> HashJoin::getInstance(
307307
return join_hash_table;
308308
}
309309

310-
std::pair<const StringDictionaryProxy*, const StringDictionaryProxy*>
311-
HashJoin::getStrDictProxies(const InnerOuter& cols, const Executor* executor) {
310+
std::pair<const StringDictionary*, const StringDictionary*> HashJoin::getStrDictProxies(
311+
const InnerOuter& cols,
312+
const Executor* executor) {
312313
const auto inner_col = cols.first;
313314
CHECK(inner_col);
314315
auto inner_type = inner_col->type();
315316
const auto outer_col = dynamic_cast<const hdk::ir::ColumnVar*>(cols.second);
316-
std::pair<const StringDictionaryProxy*, const StringDictionaryProxy*>
317+
std::pair<const StringDictionary*, const StringDictionary*>
317318
inner_outer_str_dict_proxies{nullptr, nullptr};
318319
if (inner_type->isExtDictionary() && outer_col) {
319320
CHECK(outer_col->type()->isExtDictionary());
320321
auto inner_dict_id = inner_type->as<hdk::ir::ExtDictionaryType>()->dictId();
321322
auto outer_dict_id = outer_col->type()->as<hdk::ir::ExtDictionaryType>()->dictId();
322323
inner_outer_str_dict_proxies.first =
323-
executor->getStringDictionaryProxy(inner_dict_id, true);
324+
executor->getStringDictionary(inner_dict_id, true);
324325
CHECK(inner_outer_str_dict_proxies.first);
325326
inner_outer_str_dict_proxies.second =
326-
executor->getStringDictionaryProxy(outer_dict_id, true);
327+
executor->getStringDictionary(outer_dict_id, true);
327328
CHECK(inner_outer_str_dict_proxies.second);
328329
if (*inner_outer_str_dict_proxies.first == *inner_outer_str_dict_proxies.second) {
329330
// Dictionaries are the same - don't need to translate
@@ -431,9 +432,9 @@ std::vector<const std::vector<int32_t>*> HashJoin::translateCompositeStrDictProx
431432
inner_proxies[proxy_pair_idx] && outer_proxies[proxy_pair_idx];
432433
if (translate_proxies) {
433434
const auto inner_proxy =
434-
reinterpret_cast<const StringDictionaryProxy*>(inner_proxies[proxy_pair_idx]);
435+
reinterpret_cast<const StringDictionary*>(inner_proxies[proxy_pair_idx]);
435436
const auto outer_proxy =
436-
reinterpret_cast<const StringDictionaryProxy*>(outer_proxies[proxy_pair_idx]);
437+
reinterpret_cast<const StringDictionary*>(outer_proxies[proxy_pair_idx]);
437438
CHECK(inner_proxy);
438439
CHECK(outer_proxy);
439440

omniscidb/QueryEngine/JoinHashTable/HashJoin.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,9 @@ class HashJoin {
263263
const CompositeKeyInfo& composite_key_info,
264264
const Executor* executor);
265265

266-
static std::pair<const StringDictionaryProxy*, const StringDictionaryProxy*>
267-
getStrDictProxies(const InnerOuter& cols, const Executor* executor);
266+
static std::pair<const StringDictionary*, const StringDictionary*> getStrDictProxies(
267+
const InnerOuter& cols,
268+
const Executor* executor);
268269

269270
static const std::vector<int32_t>* translateInnerToOuterStrDictProxies(
270271
const InnerOuter& cols,

omniscidb/QueryEngine/JoinHashTable/PerfectJoinHashTable.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,9 @@ bool needs_dictionary_translation(const hdk::ir::ColumnVar* inner_col,
266266

267267
auto inner_dict_id = inner_type->as<hdk::ir::ExtDictionaryType>()->dictId();
268268
auto outer_dict_id = outer_type->as<hdk::ir::ExtDictionaryType>()->dictId();
269-
const auto inner_str_dict_proxy =
270-
executor->getStringDictionaryProxy(inner_dict_id, true);
269+
const auto inner_str_dict_proxy = executor->getStringDictionary(inner_dict_id, true);
271270
CHECK(inner_str_dict_proxy);
272-
const auto outer_str_dict_proxy =
273-
executor->getStringDictionaryProxy(outer_dict_id, true);
271+
const auto outer_str_dict_proxy = executor->getStringDictionary(outer_dict_id, true);
274272
CHECK(outer_str_dict_proxy);
275273

276274
return *inner_str_dict_proxy != *outer_str_dict_proxy;

omniscidb/QueryEngine/JoinHashTable/Runtime/HashJoinKeyHandlers.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "Logger/Logger.h"
2828
#include "QueryEngine/RuntimeFunctions.h"
2929
#include "StringDictionary/StringDictionary.h"
30-
#include "StringDictionary/StringDictionaryProxy.h"
3130
#endif
3231

3332
#include <cmath>

omniscidb/QueryEngine/JoinHashTable/Runtime/HashJoinRuntime.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "QueryEngine/RuntimeFunctions.h"
3333
#include "Shared/likely.h"
3434
#include "StringDictionary/StringDictionary.h"
35-
#include "StringDictionary/StringDictionaryProxy.h"
3635

3736
#ifndef _MSC_VER
3837
#include <x86intrin.h>

0 commit comments

Comments
 (0)