MCPcopy Create free account
hub / github.com/bytedance/bolt / makeTableType

Function makeTableType

bolt/exec/HashProbe.cpp:52–78  ·  view source on GitHub ↗

Returns the type for the hash table row. Build side keys first, then dependent build side columns.

Source from the content-addressed store, hash-verified

50// Returns the type for the hash table row. Build side keys first,
51// then dependent build side columns.
52RowTypePtr makeTableType(
53 const RowType* type,
54 const std::vector<std::shared_ptr<const core::FieldAccessTypedExpr>>& keys,
55 const std::shared_ptr<const core::HashJoinNode>& joinNode) {
56 std::vector<std::string> names;
57 std::vector<TypePtr> types;
58 std::unordered_set<column_index_t> keyChannels(keys.size());
59 names.reserve(type->size());
60 types.reserve(type->size());
61 for (const auto& key : keys) {
62 auto channel = type->getChildIdx(key->name());
63 names.emplace_back(type->nameOf(channel));
64 types.emplace_back(type->childAt(channel));
65 keyChannels.insert(channel);
66 }
67 if (!canDropDuplicates(joinNode)) {
68 // For left semi and anti join with no extra filter, hash table does not
69 // store dependent columns.
70 for (auto i = 0; i < type->size(); ++i) {
71 if (keyChannels.find(i) == keyChannels.end()) {
72 names.emplace_back(type->nameOf(i));
73 types.emplace_back(type->childAt(i));
74 }
75 }
76 }
77 return ROW(std::move(names), std::move(types));
78}
79
80// Copy values from 'rows' of 'table' according to 'projections' in
81// 'result'. Reuses 'result' children where possible.

Callers 1

initializeMethod · 0.85

Calls 11

canDropDuplicatesFunction · 0.85
ROWFunction · 0.85
getChildIdxMethod · 0.80
childAtMethod · 0.80
sizeMethod · 0.45
reserveMethod · 0.45
nameMethod · 0.45
nameOfMethod · 0.45
insertMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected