| 641 | } |
| 642 | |
| 643 | SIValue AR_EXP_Evaluate |
| 644 | ( |
| 645 | AR_ExpNode *root, |
| 646 | const Record r |
| 647 | ) { |
| 648 | SIValue result; |
| 649 | AR_EXP_Result res = _AR_EXP_Evaluate(root, r, &result); |
| 650 | |
| 651 | if(res == EVAL_ERR) { |
| 652 | ErrorCtx_RaiseRuntimeException(NULL); |
| 653 | // otherwise return NULL; |
| 654 | // the query-level error will be emitted after cleanup |
| 655 | return SI_NullVal(); |
| 656 | } |
| 657 | |
| 658 | // at least one param node was encountered during evaluation, |
| 659 | // tree should be parameters free, try reducing the tree |
| 660 | if(res == EVAL_FOUND_PARAM) { |
| 661 | AR_EXP_ReduceToScalar(root, true, NULL); |
| 662 | } |
| 663 | |
| 664 | return result; |
| 665 | } |
| 666 | |
| 667 | void AR_EXP_Aggregate(AR_ExpNode *root, const Record r) { |
| 668 | if(AGGREGATION_NODE(root)) { |
no test coverage detected