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

Function _ConstructIterator

src/execution_plan/ops/op_node_by_label_scan.c:78–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78static GrB_Info _ConstructIterator
79(
80 NodeByLabelScan *op
81) {
82 GrB_Info info;
83 NodeID minId;
84 NodeID maxId;
85 GrB_Index nrows;
86
87 RG_Matrix L = Graph_GetLabelMatrix(QueryCtx_GetGraph(), op->n->label_id);
88 info = RG_Matrix_nrows(&nrows, L);
89 ASSERT(info == GrB_SUCCESS);
90
91 // make sure range is within matrix bounds
92 UnsignedRange_TightenRange(op->id_range, OP_GE, 0);
93 UnsignedRange_TightenRange(op->id_range, OP_LT, nrows);
94
95 if(!UnsignedRange_IsValid(op->id_range)) return GrB_DIMENSION_MISMATCH;
96
97 if(op->id_range->include_min) minId = op->id_range->min;
98 else minId = op->id_range->min + 1;
99
100 if(op->id_range->include_max) maxId = op->id_range->max;
101 else maxId = op->id_range->max - 1;
102
103 info = RG_MatrixTupleIter_AttachRange(&op->iter, L, minId, maxId);
104 ASSERT(info == GrB_SUCCESS);
105
106 return info;
107}
108
109static OpResult NodeByLabelScanInit
110(

Callers 3

NodeByLabelScanInitFunction · 0.85
_ResetIteratorFunction · 0.85

Calls 6

Graph_GetLabelMatrixFunction · 0.85
QueryCtx_GetGraphFunction · 0.85
RG_Matrix_nrowsFunction · 0.85
UnsignedRange_IsValidFunction · 0.85

Tested by

no test coverage detected