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 filter op clone #974

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/execution_plan/ops/op_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Forward declarations. */
static Record FilterConsume(OpBase *opBase);
static OpBase *FilterClone(const ExecutionPlan *plan, const OpBase *opBase);
static void FilterFree(OpBase *opBase);

OpBase *NewFilterOp(const ExecutionPlan *plan, FT_FilterNode *filterTree) {
Expand All @@ -16,7 +17,7 @@ OpBase *NewFilterOp(const ExecutionPlan *plan, FT_FilterNode *filterTree) {

// Set our Op operations
OpBase_Init((OpBase *)op, OPType_FILTER, "Filter", NULL, FilterConsume,
NULL, NULL, NULL, FilterFree, false, plan);
NULL, NULL, FilterClone, FilterFree, false, plan);

return (OpBase *)op;
}
Expand All @@ -40,6 +41,12 @@ static Record FilterConsume(OpBase *opBase) {
return r;
}

static inline OpBase *FilterClone(const ExecutionPlan *plan, const OpBase *opBase) {
assert(opBase->type == OPType_FILTER);
OpFilter *op = (OpFilter *)opBase;
return NewFilterOp(plan, FilterTree_Clone(op->filterTree));
}

/* Frees OpFilter*/
static void FilterFree(OpBase *ctx) {
OpFilter *filter = (OpFilter *)ctx;
Expand Down