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;
|
SColumnInfoData *pOutputData = pOutput->columnData;
|
||||||
|
|
||||||
int64_t *out = (int64_t *)pOutputData->pData;
|
int64_t *out = (int64_t *)pOutputData->pData;
|
||||||
bool hasNull = false;
|
|
||||||
*out = 0;
|
*out = 0;
|
||||||
for (int32_t i = 0; i < pInput->numOfRows; ++i) {
|
for (int32_t i = 0; i < pInput->numOfRows; ++i) {
|
||||||
if (colDataIsNull_s(pInputData, i)) {
|
if (colDataIsNull_s(pInputData, i)) {
|
||||||
hasNull = true;
|
continue;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
(*out)++;
|
(*out)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasNull) {
|
|
||||||
colDataAppendNULL(pOutputData, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
pOutput->numOfRows = 1;
|
pOutput->numOfRows = 1;
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue