refactor code
This commit is contained in:
parent
43e079c948
commit
bfb651b8c6
|
@ -1803,7 +1803,8 @@ int32_t percentileFunction(SqlFunctionCtx* pCtx) {
|
||||||
pResInfo->complete = true;
|
pResInfo->complete = true;
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
code = tMemBucketCreate(pCol->info.bytes, type, pInfo->minval, pInfo->maxval, pCtx->hasWindowOrGroup, &pInfo->pMemBucket, pInfo->numOfElems);
|
code = tMemBucketCreate(pCol->info.bytes, type, pInfo->minval, pInfo->maxval, pCtx->hasWindowOrGroup,
|
||||||
|
&pInfo->pMemBucket, pInfo->numOfElems);
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -3088,7 +3089,6 @@ int32_t lastRowFunction(SqlFunctionCtx* pCtx) {
|
||||||
pResInfo->numOfRes = 1;
|
pResInfo->numOfRes = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_VAL(pResInfo, numOfElems, 1);
|
SET_VAL(pResInfo, numOfElems, 1);
|
||||||
|
@ -6552,6 +6552,7 @@ int32_t blockDBUsageFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
if (NULL == pColInfo) {
|
if (NULL == pColInfo) {
|
||||||
return TSDB_CODE_OUT_OF_RANGE;
|
return TSDB_CODE_OUT_OF_RANGE;
|
||||||
}
|
}
|
||||||
|
int32_t len = 0;
|
||||||
int32_t row = 0;
|
int32_t row = 0;
|
||||||
char st[256] = {0};
|
char st[256] = {0};
|
||||||
|
|
||||||
|
@ -6560,10 +6561,11 @@ int32_t blockDBUsageFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
double compressRadio = 0;
|
double compressRadio = 0;
|
||||||
if (rawDataSize != 0) {
|
if (rawDataSize != 0) {
|
||||||
compressRadio = totalDiskSize * 100 / (double)rawDataSize;
|
compressRadio = totalDiskSize * 100 / (double)rawDataSize;
|
||||||
|
len = tsnprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE, "Compress_radio: %.2f", compressRadio);
|
||||||
|
} else {
|
||||||
|
len = tsnprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE, "Compress_radio: NULL");
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t len = tsnprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE, "Compress_radio: %.2f", compressRadio);
|
|
||||||
|
|
||||||
varDataSetLen(st, len);
|
varDataSetLen(st, len);
|
||||||
int32_t code = colDataSetVal(pColInfo, row++, st, false);
|
int32_t code = colDataSetVal(pColInfo, row++, st, false);
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
|
|
Loading…
Reference in New Issue