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

Function NewUpdateOp

src/execution_plan/ops/op_update.c:52–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 NULL, NULL, NULL};
51
52OpBase *NewUpdateOp(const ExecutionPlan *plan, rax *update_exps) {
53 OpUpdate *op = rm_calloc(1, sizeof(OpUpdate));
54 op->gc = QueryCtx_GetGraphCtx();
55 op->records = array_new(Record, 64);
56 op->update_ctxs = update_exps;
57 op->node_updates = HashTableCreate(&_dt);
58 op->edge_updates = HashTableCreate(&_dt);
59 op->updates_committed = false;
60
61 // set our op operations
62 OpBase_Init((OpBase *)op, OPType_UPDATE, "Update", NULL, UpdateConsume,
63 UpdateReset, NULL, UpdateClone, UpdateFree, true, plan);
64
65 // iterate over all update expressions
66 // set the record index for every entity modified by this operation
67 raxStart(&op->it, update_exps);
68 raxSeek(&op->it, "^", NULL, 0);
69 while(raxNext(&op->it)) {
70 EntityUpdateEvalCtx *ctx = op->it.data;
71 ctx->record_idx = OpBase_Modifies((OpBase *)op, ctx->alias);
72 }
73
74 return (OpBase *)op;
75}
76
77static Record UpdateConsume
78(

Callers 2

UpdateCloneFunction · 0.85
_buildUpdateOpFunction · 0.85

Calls 5

rm_callocFunction · 0.85
QueryCtx_GetGraphCtxFunction · 0.85
HashTableCreateFunction · 0.85
OpBase_InitFunction · 0.85
OpBase_ModifiesFunction · 0.85

Tested by

no test coverage detected