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

Function _AST_MapProjectionAlias

src/ast/ast_build_reference_map.c:56–66  ·  view source on GitHub ↗

Maps the RHS of "AS" projected entities.

Source from the content-addressed store, hash-verified

54
55// Maps the RHS of "AS" projected entities.
56static inline void _AST_MapProjectionAlias(AST *ast, const cypher_astnode_t *projection) {
57 const cypher_astnode_t *ast_alias = cypher_ast_projection_get_alias(projection);
58 if(ast_alias == NULL) {
59 // The projection was not aliased, so the projection itself must be an identifier.
60 ast_alias = cypher_ast_projection_get_expression(projection);
61 ASSERT(cypher_astnode_type(ast_alias) == CYPHER_AST_IDENTIFIER);
62 }
63 // WITH and RETURN projections are always either aliased or themselves identifiers.
64 const char *alias = cypher_ast_identifier_get_name(ast_alias);
65 _AST_UpdateRefMap(ast, alias);
66}
67
68// Adds referenced entities of ORDER BY clause.
69static void _AST_MapOrderByReferences(AST *ast, const cypher_astnode_t *order_by) {

Callers 1

Calls 1

_AST_UpdateRefMapFunction · 0.85

Tested by

no test coverage detected