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

Function AggregateFree

src/execution_plan/ops/op_aggregate.c:398–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396}
397
398static void AggregateFree
399(
400 OpBase *opBase
401) {
402 OpAggregate *op = (OpAggregate *)opBase;
403 if(op == NULL) {
404 return;
405 }
406
407 if(op->group_iter) {
408 HashTableReleaseIterator(op->group_iter);
409 op->group_iter = NULL;
410 }
411
412 if(op->key_exps) {
413 for(uint i = 0; i < op->key_count; i++) {
414 AR_EXP_Free(op->key_exps[i]);
415 }
416 array_free(op->key_exps);
417 op->key_exps = NULL;
418 }
419
420 if(op->aggregate_exps) {
421 for(uint i = 0; i < op->aggregate_count; i++) {
422 AR_EXP_Free(op->aggregate_exps[i]);
423 }
424 array_free(op->aggregate_exps);
425 op->aggregate_exps = NULL;
426 }
427
428 if(op->groups) {
429 HashTableRelease(op->groups);
430 op->groups = NULL;
431 }
432
433 if(op->record_offsets) {
434 array_free(op->record_offsets);
435 op->record_offsets = NULL;
436 }
437}

Callers

nothing calls this directly

Calls 4

HashTableReleaseIteratorFunction · 0.85
AR_EXP_FreeFunction · 0.85
array_freeFunction · 0.85
HashTableReleaseFunction · 0.85

Tested by

no test coverage detected