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

Function _AST_MapReferencedEdge

src/ast/ast_build_reference_map.c:98–113  ·  view source on GitHub ↗

Adds an edge to the referenced entities rax if it has multiple types or any properties (inline filter).

Source from the content-addressed store, hash-verified

96
97// Adds an edge to the referenced entities rax if it has multiple types or any properties (inline filter).
98static void _AST_MapReferencedEdge(AST *ast, const cypher_astnode_t *edge, bool force_mapping) {
99
100 const cypher_astnode_t *properties = cypher_ast_rel_pattern_get_properties(edge);
101 // Disregard empty property maps.
102 if(properties && cypher_astnode_nchildren(properties) == 0) properties = NULL;
103 // An edge with inlined filters is always referenced for the FilterTree.
104 // (In the case of a CREATE path, these are properties being set)
105 if(properties || force_mapping) {
106 const char *alias = AST_ToString(edge);
107 _AST_UpdateRefMap(ast, alias);
108
109 // Map any references within the properties map, such as 'b' in:
110 // ({val: ID(b)})
111 if(properties) _AST_MapExpression(ast, properties);
112 }
113}
114
115// Maps entities in a given path.
116static void _AST_MapReferencedEntitiesInPath(AST *ast, const cypher_astnode_t *path,

Callers 1

Calls 3

AST_ToStringFunction · 0.85
_AST_UpdateRefMapFunction · 0.85
_AST_MapExpressionFunction · 0.85

Tested by

no test coverage detected