Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added label scan clone #978

Merged
merged 6 commits into from
Feb 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/execution_plan/ops/op_node_by_label_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static Record NodeByLabelScanConsume(OpBase *opBase);
static Record NodeByLabelScanConsumeFromChild(OpBase *opBase);
static Record NodeByLabelScanNoOp(OpBase *opBase);
static OpResult NodeByLabelScanReset(OpBase *opBase);
static OpBase *NodeByLabelScanClone(const ExecutionPlan *plan, const OpBase *opBase);
static void NodeByLabelScanFree(OpBase *opBase);

static inline int NodeByLabelScanToString(const OpBase *ctx, char *buf, uint buf_len) {
Expand All @@ -33,8 +34,8 @@ OpBase *NewNodeByLabelScanOp(const ExecutionPlan *plan, const QGNode *n) {

// Set our Op operations
OpBase_Init((OpBase *)op, OPType_NODE_BY_LABEL_SCAN, "Node By Label Scan", NodeByLabelScanInit,
NodeByLabelScanConsume, NodeByLabelScanReset, NodeByLabelScanToString, NULL, NodeByLabelScanFree,
false, plan);
NodeByLabelScanConsume, NodeByLabelScanReset, NodeByLabelScanToString, NodeByLabelScanClone,
NodeByLabelScanFree, false, plan);

op->nodeRecIdx = OpBase_Modifies((OpBase *)op, n->alias);

Expand Down Expand Up @@ -162,6 +163,13 @@ static OpResult NodeByLabelScanReset(OpBase *ctx) {
return OP_OK;
}

static OpBase *NodeByLabelScanClone(const ExecutionPlan *plan, const OpBase *opBase) {
assert(opBase->type == OPType_NODE_BY_LABEL_SCAN);
NodeByLabelScan *op = (NodeByLabelScan *)opBase;
OpBase *clone = NewNodeByLabelScanOp(plan, op->n);
return clone;
}

static void NodeByLabelScanFree(OpBase *op) {
NodeByLabelScan *nodeByLabelScan = (NodeByLabelScan *)op;

Expand Down