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

Function _clause_is_eager

src/ast/ast.c:190–219  ·  view source on GitHub ↗

returns true if the given ast-node will result in an eager operation

Source from the content-addressed store, hash-verified

188
189// returns true if the given ast-node will result in an eager operation
190static bool _clause_is_eager
191(
192 const cypher_astnode_t *clause
193) {
194 // -------------------------------------------------------------------------
195 // check if clause type is one of: CREATE, DELETE, MERGE, SET or REMOVE
196 // -------------------------------------------------------------------------
197 cypher_astnode_type_t type = cypher_astnode_type(clause);
198 if(type == CYPHER_AST_CREATE ||
199 type == CYPHER_AST_DELETE ||
200 type == CYPHER_AST_MERGE ||
201 type == CYPHER_AST_SET ||
202 type == CYPHER_AST_REMOVE ||
203 type == CYPHER_AST_FOREACH) {
204 return true;
205 }
206
207 if(type == CYPHER_AST_CALL_SUBQUERY) {
208 return AST_IsEager(cypher_ast_call_subquery_get_query(clause));
209 }
210
211 // -------------------------------------------------------------------------
212 // check if clause is a WITH or RETURN clause with an aggregation
213 // -------------------------------------------------------------------------
214 if(type == CYPHER_AST_RETURN || type == CYPHER_AST_WITH) {
215 return AST_ClauseContainsAggregation(clause);
216 }
217
218 return false;
219}
220
221// checks if a query contains an ast-node corresponding to an eager operation
222bool AST_IsEager

Callers 1

AST_IsEagerFunction · 0.85

Calls 2

AST_IsEagerFunction · 0.85

Tested by

no test coverage detected