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

Function OpBase_AliasModifier

src/execution_plan/ops/op.c:96–112  ·  view source on GitHub ↗

adds an alias to an existing modifier such that record[modifier] = record[alias]

Source from the content-addressed store, hash-verified

94// adds an alias to an existing modifier
95// such that record[modifier] = record[alias]
96int OpBase_AliasModifier
97(
98 OpBase *op, // op
99 const char *modifier, // existing alias
100 const char *alias // new alias
101) {
102 rax *mapping = ExecutionPlan_GetMappings(op->plan);
103 void *id = raxFind(mapping, (unsigned char *)modifier, strlen(modifier));
104 ASSERT(id != raxNotFound);
105
106 // make sure to not introduce the same modifier twice
107 if(raxInsert(mapping, (unsigned char *)alias, strlen(alias), id, NULL)) {
108 array_append(op->modifies, alias);
109 }
110
111 return (intptr_t)id;
112}
113
114bool OpBase_ChildrenAware
115(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected