MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _ComputeGroupKey

Function _ComputeGroupKey

src/execution_plan/ops/op_aggregate.c:113–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113static XXH64_hash_t _ComputeGroupKey
114(
115 SIValue *keys,
116 OpAggregate *op,
117 Record r
118) {
119 // initialize the hash state
120 XXH64_state_t state;
121 XXH_errorcode res = XXH64_reset(&state, 0);
122 ASSERT(res != XXH_ERROR);
123
124 for(uint i = 0; i < op->key_count; i++) {
125 AR_ExpNode *exp = op->key_exps[i];
126 // note if AR_EXP_Evaluate throws a runtime exception we will leak
127 keys[i] = AR_EXP_Evaluate(exp, r);
128 // update the hash state with the current value.
129 SIValue_HashUpdate(keys[i], &state);
130 }
131
132 // finalize the hash
133 return XXH64_digest(&state);
134}
135
136// retrieves group under which given record belongs to
137// creates group if it doesn't exists

Callers 1

_GetGroupFunction · 0.85

Calls 2

AR_EXP_EvaluateFunction · 0.85
SIValue_HashUpdateFunction · 0.85

Tested by

no test coverage detected