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 cartesian product clone #963

Merged
merged 2 commits into from
Feb 26, 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
9 changes: 8 additions & 1 deletion src/execution_plan/ops/op_cartesian_product.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
static OpResult CartesianProductInit(OpBase *opBase);
static Record CartesianProductConsume(OpBase *opBase);
static OpResult CartesianProductReset(OpBase *opBase);
static OpBase *CartesianProductClone(const ExecutionPlan *plan, const OpBase *opBase);
static void CartesianProductFree(OpBase *opBase);

OpBase *NewCartesianProductOp(const ExecutionPlan *plan) {
Expand All @@ -19,7 +20,8 @@ OpBase *NewCartesianProductOp(const ExecutionPlan *plan) {

// Set our Op operations
OpBase_Init((OpBase *)op, OPType_CARTESIAN_PRODUCT, "Cartesian Product", CartesianProductInit,
CartesianProductConsume, CartesianProductReset, NULL, NULL, CartesianProductFree, false, plan);
CartesianProductConsume, CartesianProductReset, NULL, CartesianProductClone, CartesianProductFree,
false, plan);
return (OpBase *)op;
}

Expand Down Expand Up @@ -109,6 +111,11 @@ static OpResult CartesianProductReset(OpBase *opBase) {
return OP_OK;
}

static OpBase *CartesianProductClone(const ExecutionPlan *plan, const OpBase *opBase) {
assert(opBase->type == OPType_CARTESIAN_PRODUCT);
return NewCartesianProductOp(plan);
}

static void CartesianProductFree(OpBase *opBase) {
CartesianProduct *op = (CartesianProduct *)opBase;
if(op->r) {
Expand Down