MCPcopy Create free account
hub / github.com/apache/cloudberry / TupleMatchesHashFilter

Function TupleMatchesHashFilter

src/backend/executor/nodeResult.c:176–207  ·  view source on GitHub ↗

* Returns true if tuple matches hash filter. */

Source from the content-addressed store, hash-verified

174 * Returns true if tuple matches hash filter.
175 */
176static bool
177TupleMatchesHashFilter(ResultState *node, TupleTableSlot *resultSlot)
178{
179 Result *resultNode = (Result *)node->ps.plan;
180 bool res = true;
181
182 Assert(resultNode);
183 Assert(!TupIsNull(resultSlot));
184
185 if (node->hashFilter)
186 {
187 int i;
188
189 cdbhashinit(node->hashFilter);
190 for (i = 0; i < resultNode->numHashFilterCols; i++)
191 {
192 int attnum = resultNode->hashFilterColIdx[i];
193 Datum hAttr;
194 bool isnull;
195
196 hAttr = slot_getattr(resultSlot, attnum, &isnull);
197
198 cdbhash(node->hashFilter, i + 1, hAttr, isnull);
199 }
200
201 int targetSeg = cdbhashreduce(node->hashFilter);
202
203 res = (targetSeg == GpIdentity.segindex);
204 }
205
206 return res;
207}
208
209/* ----------------------------------------------------------------
210 * ExecResultMarkPos

Callers 1

ExecResultFunction · 0.85

Calls 4

cdbhashinitFunction · 0.85
slot_getattrFunction · 0.85
cdbhashFunction · 0.85
cdbhashreduceFunction · 0.85

Tested by

no test coverage detected