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

Function AST_ClauseContainsAggregation

src/ast/ast.c:551–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551bool AST_ClauseContainsAggregation
552(
553 const cypher_astnode_t *clause
554) {
555 ASSERT(clause);
556
557 bool aggregated = false;
558
559 // Retrieve all user-specified functions in clause.
560 rax *referred_funcs = raxNew();
561 AST_ReferredFunctions(clause, referred_funcs);
562
563 char funcName[32];
564 raxIterator it;
565 _prepareIterateAll(referred_funcs, &it);
566 while(raxNext(&it)) {
567 size_t len = it.key_len;
568 ASSERT(len < 32);
569 // Copy the triemap key so that we can safely add a terinator character
570 memcpy(funcName, it.key, len);
571 funcName[len] = 0;
572
573 if(AR_FuncIsAggregate(funcName)) {
574 aggregated = true;
575 break;
576 }
577 }
578 raxStop(&it);
579 raxFree(referred_funcs);
580
581 return aggregated;
582}
583
584const char **AST_BuildReturnColumnNames
585(

Callers 2

_clause_is_eagerFunction · 0.85
_buildProjectionOpsFunction · 0.85

Calls 3

AST_ReferredFunctionsFunction · 0.85
_prepareIterateAllFunction · 0.85
AR_FuncIsAggregateFunction · 0.85

Tested by

no test coverage detected