Go to the source code of this file.
Functions | |
FENNEL_BEGIN_NAMESPACE void | ExtWinAggFuncRegister (ExtendedInstructionTable *eit) |
Registers extended instructions for Windowed aggregation function support. |
FENNEL_BEGIN_NAMESPACE void ExtWinAggFuncRegister | ( | ExtendedInstructionTable * | eit | ) |
Registers extended instructions for Windowed aggregation function support.
Definition at line 509 of file ExtWinAggFuncs.cpp.
References ExtendedInstructionTable::add(), STANDARD_TYPE_CHAR, STANDARD_TYPE_DOUBLE, STANDARD_TYPE_INT_16, STANDARD_TYPE_INT_32, STANDARD_TYPE_INT_64, STANDARD_TYPE_INT_8, STANDARD_TYPE_REAL, STANDARD_TYPE_VARBINARY, STANDARD_TYPE_VARCHAR, WinAggAdd(), WinAggAvg(), WinAggCount(), WinAggDrop(), WinAggFirstValue(), WinAggInit(), WinAggLastValue(), WinAggMax(), WinAggMin(), and WinAggSum().
Referenced by CalcInit::instance().
00510 { 00511 assert(eit != NULL); 00512 00513 // WinAggInit. Overloaded for each supported data 00514 // type. Note that we have to have a separate init 00515 // for each data type but the other support functions 00516 // only have to support int64_t and double. When the 00517 // calc programs are built the small types are cast up 00518 // to the supported types. 00519 vector<StandardTypeDescriptorOrdinal> params_mm64_init; 00520 params_mm64_init.push_back(STANDARD_TYPE_VARBINARY); 00521 params_mm64_init.push_back(STANDARD_TYPE_INT_64); 00522 00523 eit->add( 00524 "WinAggInit", params_mm64_init, 00525 (ExtendedInstruction2<char*,int64_t>*) NULL, 00526 &WinAggInit); 00527 00528 vector<StandardTypeDescriptorOrdinal> params_mm32_init; 00529 params_mm32_init.push_back(STANDARD_TYPE_VARBINARY); 00530 params_mm32_init.push_back(STANDARD_TYPE_INT_32); 00531 00532 eit->add( 00533 "WinAggInit", params_mm32_init, 00534 (ExtendedInstruction2<char*,int32_t>*) NULL, 00535 &WinAggInit); 00536 00537 vector<StandardTypeDescriptorOrdinal> params_mm16_init; 00538 params_mm16_init.push_back(STANDARD_TYPE_VARBINARY); 00539 params_mm16_init.push_back(STANDARD_TYPE_INT_16); 00540 00541 eit->add( 00542 "WinAggInit", params_mm16_init, 00543 (ExtendedInstruction2<char*,int16_t>*) NULL, 00544 &WinAggInit); 00545 00546 vector<StandardTypeDescriptorOrdinal> params_mm8_init; 00547 params_mm8_init.push_back(STANDARD_TYPE_VARBINARY); 00548 params_mm8_init.push_back(STANDARD_TYPE_INT_8); 00549 00550 eit->add( 00551 "WinAggInit", params_mm8_init, 00552 (ExtendedInstruction2<char*,int8_t>*) NULL, 00553 &WinAggInit); 00554 00555 // Now the Add/Drop and functions for integers 00556 vector<StandardTypeDescriptorOrdinal> params_ad_I64; 00557 params_ad_I64.push_back(STANDARD_TYPE_INT_64); 00558 params_ad_I64.push_back(STANDARD_TYPE_VARBINARY); 00559 00560 eit->add( 00561 "WinAggAdd", params_ad_I64, 00562 (ExtendedInstruction2<int64_t, char*>*) NULL, 00563 &WinAggAdd); 00564 00565 eit->add( 00566 "WinAggDrop", params_ad_I64, 00567 (ExtendedInstruction2<int64_t, char*>*) NULL, 00568 &WinAggDrop); 00569 00570 vector<StandardTypeDescriptorOrdinal> params_I64_funcs; 00571 params_I64_funcs.push_back(STANDARD_TYPE_INT_64); 00572 params_I64_funcs.push_back(STANDARD_TYPE_VARBINARY); 00573 00574 eit->add( 00575 "WinAggSum", params_I64_funcs, 00576 (ExtendedInstruction2<int64_t, char*>*) NULL, 00577 &WinAggSum); 00578 00579 eit->add( 00580 "WinAggCount", params_I64_funcs, 00581 (ExtendedInstruction2<int64_t, char*>*) NULL, 00582 &WinAggCount); 00583 00584 eit->add( 00585 "WinAggAvg", params_I64_funcs, 00586 (ExtendedInstruction2<int64_t, char*>*) NULL, 00587 &WinAggAvg); 00588 00589 eit->add( 00590 "WinAggMin", params_I64_funcs, 00591 (ExtendedInstruction2<int64_t, char*>*) NULL, 00592 &WinAggMin); 00593 00594 eit->add( 00595 "WinAggMax", params_I64_funcs, 00596 (ExtendedInstruction2<int64_t, char*>*) NULL, 00597 &WinAggMax); 00598 00599 eit->add( 00600 "WinAggFirstValue", params_I64_funcs, 00601 (ExtendedInstruction2<int64_t, char*>*) NULL, 00602 &WinAggFirstValue); 00603 00604 eit->add( 00605 "WinAggLastValue", params_I64_funcs, 00606 (ExtendedInstruction2<int64_t, char*>*) NULL, 00607 &WinAggLastValue); 00608 00609 // Add in real number support 00610 vector<StandardTypeDescriptorOrdinal> params_mmd_init; 00611 params_mmd_init.push_back(STANDARD_TYPE_VARBINARY); 00612 params_mmd_init.push_back(STANDARD_TYPE_DOUBLE); 00613 00614 eit->add( 00615 "WinAggInit", params_mmd_init, 00616 (ExtendedInstruction2<char*,double>*) NULL, 00617 &WinAggInit); 00618 00619 vector<StandardTypeDescriptorOrdinal> params_mmr_init; 00620 params_mmr_init.push_back(STANDARD_TYPE_VARBINARY); 00621 params_mmr_init.push_back(STANDARD_TYPE_REAL); 00622 00623 eit->add( 00624 "WinAggInit", params_mmr_init, 00625 (ExtendedInstruction2<char*,float>*) NULL, 00626 &WinAggInit); 00627 00628 vector<StandardTypeDescriptorOrdinal> params_DBL_funcs; 00629 params_DBL_funcs.push_back(STANDARD_TYPE_DOUBLE); 00630 params_DBL_funcs.push_back(STANDARD_TYPE_VARBINARY); 00631 00632 eit->add( 00633 "WinAggAdd", params_DBL_funcs, 00634 (ExtendedInstruction2<double, char*>*) NULL, 00635 &WinAggAdd); 00636 00637 eit->add( 00638 "WinAggDrop", params_DBL_funcs, 00639 (ExtendedInstruction2<double, char*>*) NULL, 00640 &WinAggDrop); 00641 00642 eit->add( 00643 "WinAggMin", params_DBL_funcs, 00644 (ExtendedInstruction2<double, char*>*) NULL, 00645 &WinAggMin); 00646 00647 eit->add( 00648 "WinAggMax", params_DBL_funcs, 00649 (ExtendedInstruction2<double, char*>*) NULL, 00650 &WinAggMax); 00651 00652 eit->add( 00653 "WinAggSum", params_DBL_funcs, 00654 (ExtendedInstruction2<double, char*>*) NULL, 00655 &WinAggSum); 00656 00657 eit->add( 00658 "WinAggAvg", params_DBL_funcs, 00659 (ExtendedInstruction2<double, char*>*) NULL, 00660 &WinAggAvg); 00661 00662 eit->add( 00663 "WinAggFirstValue", params_DBL_funcs, 00664 (ExtendedInstruction2<double, char*>*) NULL, 00665 &WinAggFirstValue); 00666 00667 eit->add( 00668 "WinAggLastValue", params_DBL_funcs, 00669 (ExtendedInstruction2<double, char*>*) NULL, 00670 &WinAggLastValue); 00671 00672 // support for CHAR and VARCHAR 00673 vector<StandardTypeDescriptorOrdinal> params_mmvc_init; 00674 params_mmvc_init.push_back(STANDARD_TYPE_VARBINARY); 00675 params_mmvc_init.push_back(STANDARD_TYPE_VARCHAR); 00676 00677 eit->add( 00678 "WinAggInit", params_mmvc_init, 00679 (ExtendedInstruction2<char*,char*>*) NULL, 00680 &WinAggInit); 00681 00682 vector<StandardTypeDescriptorOrdinal> params_StrA_funcs; 00683 params_StrA_funcs.push_back(STANDARD_TYPE_VARCHAR); 00684 params_StrA_funcs.push_back(STANDARD_TYPE_VARBINARY); 00685 00686 eit->add( 00687 "WinAggAdd", params_StrA_funcs, 00688 (ExtendedInstruction2<char *, char*>*) NULL, 00689 &WinAggAdd); 00690 00691 eit->add( 00692 "WinAggDrop", params_StrA_funcs, 00693 (ExtendedInstruction2<char*, char*>*) NULL, 00694 &WinAggDrop); 00695 00696 eit->add( 00697 "WinAggMin", params_StrA_funcs, 00698 (ExtendedInstruction2<char*, char*>*) NULL, 00699 &WinAggMin); 00700 00701 eit->add( 00702 "WinAggMax", params_StrA_funcs, 00703 (ExtendedInstruction2<char*, char*>*) NULL, 00704 &WinAggMax); 00705 00706 eit->add( 00707 "WinAggFirstValue", params_StrA_funcs, 00708 (ExtendedInstruction2<char*, char*>*) NULL, 00709 &WinAggFirstValue); 00710 00711 eit->add( 00712 "WinAggLastValue", params_StrA_funcs, 00713 (ExtendedInstruction2<char*, char*>*) NULL, 00714 &WinAggLastValue); 00715 00716 vector<StandardTypeDescriptorOrdinal> params_mmc_init; 00717 params_mmc_init.push_back(STANDARD_TYPE_VARBINARY); 00718 params_mmc_init.push_back(STANDARD_TYPE_CHAR); 00719 00720 eit->add( 00721 "WinAggInit", params_mmc_init, 00722 (ExtendedInstruction2<char*,char*>*) NULL, 00723 &WinAggInit); 00724 00725 vector<StandardTypeDescriptorOrdinal> params_StrA2_funcs; 00726 params_StrA2_funcs.push_back(STANDARD_TYPE_CHAR); 00727 params_StrA2_funcs.push_back(STANDARD_TYPE_VARBINARY); 00728 00729 eit->add( 00730 "WinAggAdd", params_StrA2_funcs, 00731 (ExtendedInstruction2<char *, char*>*) NULL, 00732 &WinAggAdd); 00733 00734 eit->add( 00735 "WinAggDrop", params_StrA2_funcs, 00736 (ExtendedInstruction2<char*, char*>*) NULL, 00737 &WinAggDrop); 00738 00739 eit->add( 00740 "WinAggMin", params_StrA2_funcs, 00741 (ExtendedInstruction2<char*, char*>*) NULL, 00742 &WinAggMin); 00743 00744 eit->add( 00745 "WinAggMax", params_StrA2_funcs, 00746 (ExtendedInstruction2<char*, char*>*) NULL, 00747 &WinAggMax); 00748 00749 eit->add( 00750 "WinAggFirstValue", params_StrA2_funcs, 00751 (ExtendedInstruction2<char*, char*>*) NULL, 00752 &WinAggFirstValue); 00753 00754 eit->add( 00755 "WinAggLastValue", params_StrA2_funcs, 00756 (ExtendedInstruction2<char*, char*>*) NULL, 00757 &WinAggLastValue); 00758 }