fix(query): opt show disk_info output

This commit is contained in:
yihaoDeng 2025-03-05 18:08:36 +08:00
parent ba50e36363
commit 250d0bc73c
2 changed files with 4 additions and 3 deletions

View File

@ -797,7 +797,7 @@ static bool funcNotSupportStringSma(SFunctionNode* pFunc) {
}
EFuncDataRequired statisDataRequired(SFunctionNode* pFunc, STimeWindow* pTimeWindow) {
if(funcNotSupportStringSma(pFunc)) {
if (funcNotSupportStringSma(pFunc)) {
return FUNC_DATA_REQUIRED_DATA_LOAD;
}
return FUNC_DATA_REQUIRED_SMA_LOAD;
@ -6618,7 +6618,7 @@ int32_t blockDBUsageFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
double compressRadio = 0;
if (rawDataSize != 0) {
compressRadio = totalDiskSize * 100 / (double)rawDataSize;
len = tsnprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE, "Compress_radio=[%.2f]", compressRadio);
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]");
}

View File

@ -102,7 +102,8 @@ class TDTestCase:
elif "Compress_radio=" in item[0]:
value = item[0].split("=")[1].split(" ")[0].replace("[", "").replace("]", "")
if value != 'NULL':
compress_radio = float(value)
tValue = value[0:len(value) - 1]
compress_radio = float(tValue)
#tdLog.debug("compress_occupied: %s" % compress_radio)
return disk_occupied, compress_radio