| 346 | } |
| 347 | |
| 348 | static OpBase *AggregateClone |
| 349 | ( |
| 350 | const ExecutionPlan *plan, |
| 351 | const OpBase *opBase |
| 352 | ) { |
| 353 | ASSERT(opBase->type == OPType_AGGREGATE); |
| 354 | |
| 355 | OpAggregate *op = (OpAggregate *)opBase; |
| 356 | uint key_count = op->key_count; |
| 357 | uint aggregate_count = op->aggregate_count; |
| 358 | AR_ExpNode **exps = array_new(AR_ExpNode *, aggregate_count + key_count); |
| 359 | |
| 360 | for(uint i = 0; i < key_count; i++) { |
| 361 | array_append(exps, AR_EXP_Clone(op->key_exps[i])); |
| 362 | } |
| 363 | |
| 364 | for(uint i = 0; i < aggregate_count; i++) { |
| 365 | array_append(exps, AR_EXP_Clone(op->aggregate_exps[i])); |
| 366 | } |
| 367 | |
| 368 | return NewAggregateOp(plan, exps); |
| 369 | } |
| 370 | |
| 371 | // bind the Aggregate operation to the execution plan |
| 372 | void AggregateBindToPlan |
nothing calls this directly
no test coverage detected