* Extract the attributes that make up the grouping key into the * hashslot. This is necessary to compute the hash or perform a lookup. */
| 1261 | * hashslot. This is necessary to compute the hash or perform a lookup. |
| 1262 | */ |
| 1263 | static inline void |
| 1264 | prepare_hash_slot(AggStatePerHash perhash, |
| 1265 | TupleTableSlot *inputslot, |
| 1266 | TupleTableSlot *hashslot) |
| 1267 | { |
| 1268 | int i; |
| 1269 | |
| 1270 | /* transfer just the needed columns into hashslot */ |
| 1271 | slot_getsomeattrs(inputslot, perhash->largestGrpColIdx); |
| 1272 | ExecClearTuple(hashslot); |
| 1273 | |
| 1274 | for (i = 0; i < perhash->numhashGrpCols; i++) |
| 1275 | { |
| 1276 | int varNumber = perhash->hashGrpColIdxInput[i] - 1; |
| 1277 | |
| 1278 | hashslot->tts_values[i] = inputslot->tts_values[varNumber]; |
| 1279 | hashslot->tts_isnull[i] = inputslot->tts_isnull[varNumber]; |
| 1280 | } |
| 1281 | ExecStoreVirtualTuple(hashslot); |
| 1282 | } |
| 1283 | |
| 1284 | /* |
| 1285 | * Prepare to finalize and project based on the specified representative tuple |
no test coverage detected