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

Function AR_ENDNODE

src/arithmetic/entity_funcs/entity_funcs.c:118–131  ·  view source on GitHub ↗

returns the end node of a relationship. */

Source from the content-addressed store, hash-verified

116
117/* returns the end node of a relationship. */
118SIValue AR_ENDNODE(SIValue *argv, int argc, void *private_data) {
119 if(SI_TYPE(argv[0]) == T_NULL) return SI_NullVal();
120 Edge *e = argv[0].ptrval;
121 NodeID end_id = Edge_GetDestNodeID(e);
122 GraphContext *gc = QueryCtx_GetGraphCtx();
123 Node *dest = rm_malloc(sizeof(Node));
124 *dest = GE_NEW_NODE();
125 // Retrieve the node from the graph.
126 Graph_GetNode(gc->g, end_id, dest);
127 SIValue si_node = SI_Node(dest);
128 // Mark this value as a heap allocation so that it gets freed properly.
129 SIValue_SetAllocationType(&si_node, M_SELF);
130 return si_node;
131}
132
133/* returns true if the specified property exists in the node, or relationship. */
134SIValue AR_EXISTS(SIValue *argv, int argc, void *private_data) {

Callers

nothing calls this directly

Calls 7

SI_NullValFunction · 0.85
Edge_GetDestNodeIDFunction · 0.85
QueryCtx_GetGraphCtxFunction · 0.85
rm_mallocFunction · 0.85
Graph_GetNodeFunction · 0.85
SI_NodeFunction · 0.85

Tested by

no test coverage detected