| 107 | } |
| 108 | |
| 109 | static 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 | |
| 139 | static inline void _UpdateRecord |
| 140 | ( |
nothing calls this directly
no test coverage detected