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

Function _AST_MapWithReferredEntities

src/ast/ast_build_reference_map.c:414–425  ·  view source on GitHub ↗

Map the LHS of "AS" projected entities. "WITH a as x order by x" will just collect a to the map.

Source from the content-addressed store, hash-verified

412
413// Map the LHS of "AS" projected entities. "WITH a as x order by x" will just collect a to the map.
414static void _AST_MapWithReferredEntities(AST *ast_segment, const cypher_astnode_t *with_clause) {
415 int projectionCount = cypher_ast_with_nprojections(with_clause);
416 for(uint i = 0 ; i < projectionCount; i ++) {
417 const cypher_astnode_t *projection = cypher_ast_with_get_projection(with_clause, i);
418 // The expression forms the LHS of the projection.
419 const cypher_astnode_t *exp = cypher_ast_projection_get_expression(projection);
420 _AST_MapExpression(ast_segment, exp);
421 }
422 // Add referenced aliases for WITH's ORDER BY entities.
423 const cypher_astnode_t *order_by = cypher_ast_with_get_order_by(with_clause);
424 if(order_by) _AST_MapOrderByReferences(ast_segment, order_by);
425}
426
427// Map the LHS of "AS" projected entities. "RETURN a as x order by x" will just collect a to the map.
428static void _AST_MapReturnReferredEntities(AST *ast_segment,

Callers 1

_AST_MapProjectionClauseFunction · 0.85

Calls 2

_AST_MapExpressionFunction · 0.85

Tested by

no test coverage detected