refactor: remove one function.
This commit is contained in:
parent
13028744df
commit
55724157c4
|
@ -177,7 +177,6 @@ static FORCE_INLINE void colDataSetDouble(SColumnInfoData* pColumnInfoData, uint
|
|||
int32_t getJsonValueLen(const char* data);
|
||||
|
||||
int32_t colDataSetVal(SColumnInfoData* pColumnInfoData, uint32_t rowIndex, const char* pData, bool isNull);
|
||||
int32_t colDataAppend(SColumnInfoData* pColumnInfoData, uint32_t rowIndex, const char* pData, bool isNull);
|
||||
int32_t colDataReassignVal(SColumnInfoData* pColumnInfoData, uint32_t dstRowIdx, uint32_t srcRowIdx, const char* pData);
|
||||
int32_t colDataSetNItems(SColumnInfoData* pColumnInfoData, uint32_t rowIndex, const char* pData, uint32_t numOfRows, bool trimValue);
|
||||
int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int32_t* capacity,
|
||||
|
|
|
@ -74,10 +74,6 @@ int32_t getJsonValueLen(const char* data) {
|
|||
return dataLen;
|
||||
}
|
||||
|
||||
int32_t colDataAppend(SColumnInfoData* pColumnInfoData, uint32_t rowIndex, const char* pData, bool isNull) {
|
||||
return colDataSetVal(pColumnInfoData, rowIndex, pData, isNull);
|
||||
}
|
||||
|
||||
int32_t colDataSetVal(SColumnInfoData* pColumnInfoData, uint32_t rowIndex, const char* pData, bool isNull) {
|
||||
if (isNull) {
|
||||
// There is a placehold for each NULL value of binary or nchar type.
|
||||
|
|
|
@ -542,32 +542,32 @@ int32_t mndRetrieveTagIdx(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, i
|
|||
STR_TO_VARSTR(n3, (char *)tNameGetTableName(&stbName));
|
||||
|
||||
SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
colDataAppend(pColInfo, numOfRows, (const char *)n1, false);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)n1, false);
|
||||
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
colDataAppend(pColInfo, numOfRows, (const char *)n2, false);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)n2, false);
|
||||
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
colDataAppend(pColInfo, numOfRows, (const char *)n3, false);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)n3, false);
|
||||
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
|
||||
colDataAppend(pColInfo, numOfRows, (const char *)&invalid, false);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)&invalid, false);
|
||||
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
colDataAppend(pColInfo, numOfRows, (const char *)&pIdx->createdTime, false);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)&pIdx->createdTime, false);
|
||||
|
||||
char col[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
|
||||
STR_TO_VARSTR(col, (char *)pIdx->colName);
|
||||
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
colDataAppend(pColInfo, numOfRows, (const char *)col, false);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)col, false);
|
||||
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
|
||||
char tag[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
|
||||
STR_TO_VARSTR(tag, (char *)"tag_index");
|
||||
colDataAppend(pColInfo, numOfRows, (const char *)tag, false);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)tag, false);
|
||||
|
||||
numOfRows++;
|
||||
sdbRelease(pSdb, pIdx);
|
||||
|
|
|
@ -1278,13 +1278,13 @@ static int32_t mndRetrieveSma(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc
|
|||
STR_TO_VARSTR(col, (char *)"");
|
||||
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
colDataAppend(pColInfo, numOfRows, (const char *)col, false);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)col, false);
|
||||
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
|
||||
char tag[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
|
||||
STR_TO_VARSTR(tag, (char *)"sma_index");
|
||||
colDataAppend(pColInfo, numOfRows, (const char *)tag, false);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)tag, false);
|
||||
|
||||
numOfRows++;
|
||||
sdbRelease(pSdb, pSma);
|
||||
|
|
|
@ -874,7 +874,7 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p
|
|||
// if (pDb == NULL || pDb->compactStartTime <= 0) {
|
||||
// colDataSetNULL(pColInfo, numOfRows);
|
||||
// } else {
|
||||
// colDataAppend(pColInfo, numOfRows, (const char *)&pDb->compactStartTime, false);
|
||||
// colDataSetVal(pColInfo, numOfRows, (const char *)&pDb->compactStartTime, false);
|
||||
// }
|
||||
|
||||
numOfRows++;
|
||||
|
|
|
@ -392,7 +392,7 @@ static int32_t setAliveResultIntoDataBlock(int64_t* pConnId, SSDataBlock* pBlock
|
|||
int32_t status = 0;
|
||||
int32_t code = getAliveStatusFromApi(pConnId, dbName, &status);
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
colDataAppend(pCol1, 0, (const char*)&status, false);
|
||||
colDataSetVal(pCol1, 0, (const char*)&status, false);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -1033,7 +1033,7 @@ void appendCreateTableRow(void* pState, SExprSupp* pTableSup, SExprSupp* pTagSup
|
|||
}
|
||||
|
||||
void* pGpIdCol = taosArrayGet(pDestBlock->pDataBlock, UD_GROUPID_COLUMN_INDEX);
|
||||
colDataAppend(pGpIdCol, pDestBlock->info.rows, (const char*)&groupId, false);
|
||||
colDataSetVal(pGpIdCol, pDestBlock->info.rows, (const char*)&groupId, false);
|
||||
pDestBlock->info.rows++;
|
||||
blockDataDestroy(pTmpBlock);
|
||||
} else {
|
||||
|
|
|
@ -966,20 +966,20 @@ static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo,
|
|||
|
||||
// table name
|
||||
pColInfoData = taosArrayGet(dataBlock->pDataBlock, 0);
|
||||
colDataAppend(pColInfoData, numOfRows, tName, false);
|
||||
colDataSetVal(pColInfoData, numOfRows, tName, false);
|
||||
|
||||
// database name
|
||||
pColInfoData = taosArrayGet(dataBlock->pDataBlock, 1);
|
||||
colDataAppend(pColInfoData, numOfRows, dbname, false);
|
||||
colDataSetVal(pColInfoData, numOfRows, dbname, false);
|
||||
|
||||
pColInfoData = taosArrayGet(dataBlock->pDataBlock, 2);
|
||||
colDataAppend(pColInfoData, numOfRows, tableType, false);
|
||||
colDataSetVal(pColInfoData, numOfRows, tableType, false);
|
||||
|
||||
// col name
|
||||
char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
|
||||
STR_TO_VARSTR(colName, schemaRow->pSchema[i].name);
|
||||
pColInfoData = taosArrayGet(dataBlock->pDataBlock, 3);
|
||||
colDataAppend(pColInfoData, numOfRows, colName, false);
|
||||
colDataSetVal(pColInfoData, numOfRows, colName, false);
|
||||
|
||||
// col type
|
||||
int8_t colType = schemaRow->pSchema[i].type;
|
||||
|
@ -994,10 +994,10 @@ static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo,
|
|||
(int32_t)((schemaRow->pSchema[i].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE));
|
||||
}
|
||||
varDataSetLen(colTypeStr, colTypeLen);
|
||||
colDataAppend(pColInfoData, numOfRows, (char*)colTypeStr, false);
|
||||
colDataSetVal(pColInfoData, numOfRows, (char*)colTypeStr, false);
|
||||
|
||||
pColInfoData = taosArrayGet(dataBlock->pDataBlock, 5);
|
||||
colDataAppend(pColInfoData, numOfRows, (const char*)&schemaRow->pSchema[i].bytes, false);
|
||||
colDataSetVal(pColInfoData, numOfRows, (const char*)&schemaRow->pSchema[i].bytes, false);
|
||||
|
||||
for (int32_t j = 6; j <= 8; ++j) {
|
||||
pColInfoData = taosArrayGet(dataBlock->pDataBlock, j);
|
||||
|
|
|
@ -270,7 +270,7 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
|
|||
continue;
|
||||
} else if (isIsfilledPseudoColumn(pExprInfo)) {
|
||||
bool isFilled = true;
|
||||
colDataAppend(pDst, pResBlock->info.rows, (char*)&isFilled, false);
|
||||
colDataSetVal(pDst, pResBlock->info.rows, (char*)&isFilled, false);
|
||||
continue;
|
||||
} else if (!isInterpFunc(pExprInfo)) {
|
||||
if (isGroupKeyFunc(pExprInfo)) {
|
||||
|
|
|
@ -1712,7 +1712,7 @@ int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
|||
SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId);
|
||||
|
||||
varDataSetLen(buf, len);
|
||||
colDataAppend(pCol, pBlock->info.rows, buf, false);
|
||||
colDataSetVal(pCol, pBlock->info.rows, buf, false);
|
||||
|
||||
tMemBucketDestroy(pMemBucket);
|
||||
return pResInfo->numOfRes;
|
||||
|
|
|
@ -145,7 +145,7 @@ int32_t executeMakePointFunc(SColumnInfoData *pInputData[], int32_t iLeft, int32
|
|||
goto _exit;
|
||||
}
|
||||
|
||||
colDataAppend(pOutputData, TMAX(iLeft, iRight), output, (output == NULL));
|
||||
colDataSetVal(pOutputData, TMAX(iLeft, iRight), output, (output == NULL));
|
||||
|
||||
_exit:
|
||||
if (output) {
|
||||
|
@ -165,7 +165,7 @@ int32_t executeGeomFromTextFunc(SColumnInfoData *pInputData, int32_t i, SColumnI
|
|||
goto _exit;
|
||||
}
|
||||
|
||||
colDataAppend(pOutputData, i, output, (output == NULL));
|
||||
colDataSetVal(pOutputData, i, output, (output == NULL));
|
||||
|
||||
_exit:
|
||||
if (output) {
|
||||
|
@ -185,7 +185,7 @@ int32_t executeAsTextFunc(SColumnInfoData *pInputData, int32_t i, SColumnInfoDat
|
|||
goto _exit;
|
||||
}
|
||||
|
||||
colDataAppend(pOutputData, i, output, (output == NULL));
|
||||
colDataSetVal(pOutputData, i, output, (output == NULL));
|
||||
|
||||
_exit:
|
||||
if (output) {
|
||||
|
@ -213,7 +213,7 @@ int32_t executeRelationFunc(const GEOSGeometry *geom1, const GEOSPreparedGeometr
|
|||
}
|
||||
}
|
||||
|
||||
colDataAppend(pOutputData, i, &res, (res==-1));
|
||||
colDataSetVal(pOutputData, i, &res, (res==-1));
|
||||
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ void setScalarParam(SScalarParam *sclParam, int32_t type, void *valueArray, TDRo
|
|||
}
|
||||
else {
|
||||
const char *val = (const char *)valueArray + (i * bytes);
|
||||
colDataAppend(sclParam->columnData, i, val, false);
|
||||
colDataSetVal(sclParam->columnData, i, val, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue