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

Function OptionalConsume

src/execution_plan/ops/op_optional.c:25–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25static Record OptionalConsume(OpBase *opBase) {
26 Optional *op = (Optional *)opBase;
27 // try to produce a Record from the child op.
28 Record r = OpBase_Consume(opBase->children[0]);
29
30 // create an empty Record if the child returned NULL
31 // and this op has not yet returned data.
32 if(!r && !op->emitted_record) {
33 r = OpBase_CreateRecord(opBase);
34 }
35
36 // don't produce multiple empty Records.
37 op->emitted_record = true;
38
39 return r;
40}
41
42static OpResult OptionalReset(OpBase *opBase) {
43 Optional *op = (Optional *)opBase;

Callers

nothing calls this directly

Calls 2

OpBase_ConsumeFunction · 0.85
OpBase_CreateRecordFunction · 0.85

Tested by

no test coverage detected