MCPcopy Create free account
hub / github.com/cwida/ALP / joinAll

Method joinAll

publication/source_code/bench_end_to_end/src/vectorwise/Operators.cpp:126–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126pos_t Hashjoin::joinAll() {
127 size_t found = 0;
128 // perform continuation
129 for (auto entry = cont.buildMatch; entry != shared.ht.end(); entry = entry->next) {
130 if (entry->hash == cont.probeHash) {
131 buildMatches[found] = entry;
132 probeMatches[found++] = cont.nextProbe;
133 if (found == batchSize) {
134 // output buffers are full, save state for continuation
135 cont.buildMatch = entry->next;
136 return batchSize;
137 }
138 }
139 }
140 if (cont.buildMatch != shared.ht.end()) cont.nextProbe++;
141 for (size_t i = cont.nextProbe, end = cont.numProbes; i < end; ++i) {
142 auto hash = probeHashes[i];
143 for (auto entry = shared.ht.find_chain_tagged(hash); entry != shared.ht.end(); entry = entry->next) {
144 if (entry->hash == hash) {
145 buildMatches[found] = entry;
146 probeMatches[found++] = i;
147 if (found == batchSize && (entry->next || i + 1 < end)) {
148 // output buffers are full, save state for continuation
149 cont.buildMatch = entry->next;
150 cont.probeHash = hash;
151 cont.nextProbe = i;
152 return batchSize;
153 }
154 }
155 }
156 }
157 cont.buildMatch = shared.ht.end();
158 cont.nextProbe = cont.numProbes;
159 return found;
160}
161
162pos_t Hashjoin::joinAllParallel() {
163 size_t found = 0;

Callers

nothing calls this directly

Calls 2

find_chain_taggedMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected