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

Function _ValidateFunctionCall

src/ast/ast_validations.c:530–548  ·  view source on GitHub ↗

validate a function-call

Source from the content-addressed store, hash-verified

528
529// validate a function-call
530static AST_Validation _ValidateFunctionCall
531(
532 const char *funcName, // function name
533 bool include_aggregates // are aggregations allowed
534) {
535 // check existence of the function-name
536 if(!AR_FuncExists(funcName)) {
537 ErrorCtx_SetError("Unknown function '%s'", funcName);
538 return AST_INVALID;
539 }
540
541 if(!include_aggregates && AR_FuncIsAggregate(funcName)) {
542 // Provide a unique error for using aggregate functions from inappropriate contexts
543 ErrorCtx_SetError("Invalid use of aggregating function '%s'", funcName);
544 return AST_INVALID;
545 }
546
547 return AST_VALID;
548}
549
550// validate an apply-all operator
551static VISITOR_STRATEGY _Validate_apply_all_operator

Callers 1

_Validate_apply_operatorFunction · 0.85

Calls 3

AR_FuncExistsFunction · 0.85
ErrorCtx_SetErrorFunction · 0.85
AR_FuncIsAggregateFunction · 0.85

Tested by

no test coverage detected