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

Function NodeByLabelScanInit

src/execution_plan/ops/op_node_by_label_scan.c:109–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static OpResult NodeByLabelScanInit
110(
111 OpBase *opBase
112) {
113 NodeByLabelScan *op = (NodeByLabelScan *)opBase;
114 OpBase_UpdateConsume(opBase, NodeByLabelScanConsume); // default consume function
115
116 // operation has children, consume from child
117 if(opBase->childCount > 0) {
118 OpBase_UpdateConsume(opBase, NodeByLabelScanConsumeFromChild);
119 return OP_OK;
120 }
121
122 if(op->n->label_id == GRAPH_UNKNOWN_LABEL) {
123 // missing schema, use the NOP consume function
124 OpBase_UpdateConsume(opBase, NodeByLabelScanNoOp);
125 return OP_OK;
126 }
127
128 // the iterator build may fail if the ID range does not match the matrix dimensions
129 GrB_Info iterator_built = _ConstructIterator(op);
130 if(iterator_built != GrB_SUCCESS) {
131 // invalid range, use the NOP consume function
132 OpBase_UpdateConsume(opBase, NodeByLabelScanNoOp);
133 return OP_OK;
134 }
135
136 return OP_OK;
137}
138
139static inline void _UpdateRecord
140(

Callers

nothing calls this directly

Calls 2

OpBase_UpdateConsumeFunction · 0.85
_ConstructIteratorFunction · 0.85

Tested by

no test coverage detected