fix count scalar function behavior
This commit is contained in:
parent
a57d2417c3
commit
6d63d1b5b8
|
@ -1746,20 +1746,14 @@ int32_t countScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam
|
|||
SColumnInfoData *pOutputData = pOutput->columnData;
|
||||
|
||||
int64_t *out = (int64_t *)pOutputData->pData;
|
||||
bool hasNull = false;
|
||||
*out = 0;
|
||||
for (int32_t i = 0; i < pInput->numOfRows; ++i) {
|
||||
if (colDataIsNull_s(pInputData, i)) {
|
||||
hasNull = true;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
(*out)++;
|
||||
}
|
||||
|
||||
if (hasNull) {
|
||||
colDataAppendNULL(pOutputData, 0);
|
||||
}
|
||||
|
||||
pOutput->numOfRows = 1;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue