feat(query): add state_count function

This commit is contained in:
Ganlin Zhao 2022-05-10 20:32:03 +08:00
parent 85adb8611c
commit 3c7b971841
1 changed files with 4 additions and 0 deletions

View File

@ -2527,6 +2527,10 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) {
SColumnInfoData* pOutput = (SColumnInfoData*)pCtx->pOutput;
int8_t op = getStateOpType(varDataVal(pCtx->param[1].param.pz));
if (STATE_OPER_INVALID == op) {
return 0;
}
for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; i += 1) {
numOfElems++;
if (colDataIsNull_f(pInputCol->nullbitmap, i)) {