refactor: do some internal refactor.
This commit is contained in:
parent
09fc0b791d
commit
c0b7b1302b
|
@ -27,9 +27,14 @@ static int32_t getSchemaBytes(const SSchema* pSchema) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo : to convert data according to SSDatablock
|
||||||
static void buildRspData(const STableMeta* pMeta, char* pData) {
|
static void buildRspData(const STableMeta* pMeta, char* pData) {
|
||||||
int32_t* pColSizes = (int32_t*)pData;
|
int32_t* payloadLen = (int32_t*) pData;
|
||||||
pData += DESCRIBE_RESULT_COLS * sizeof(int32_t);
|
uint64_t* groupId = (uint64_t*)(pData + sizeof(int32_t));
|
||||||
|
|
||||||
|
int32_t* pColSizes = (int32_t*)(pData + sizeof(int32_t) + sizeof(uint64_t));
|
||||||
|
pData = (char*) pColSizes + DESCRIBE_RESULT_COLS * sizeof(int32_t);
|
||||||
|
|
||||||
int32_t numOfRows = TABLE_TOTAL_COL_NUM(pMeta);
|
int32_t numOfRows = TABLE_TOTAL_COL_NUM(pMeta);
|
||||||
|
|
||||||
// Field
|
// Field
|
||||||
|
@ -79,6 +84,9 @@ static void buildRspData(const STableMeta* pMeta, char* pData) {
|
||||||
for (int32_t i = 0; i < DESCRIBE_RESULT_COLS; ++i) {
|
for (int32_t i = 0; i < DESCRIBE_RESULT_COLS; ++i) {
|
||||||
pColSizes[i] = htonl(pColSizes[i]);
|
pColSizes[i] = htonl(pColSizes[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
*payloadLen = (int32_t)(pData - (char*)payloadLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t calcRspSize(const STableMeta* pMeta) {
|
static int32_t calcRspSize(const STableMeta* pMeta) {
|
||||||
|
@ -87,7 +95,8 @@ static int32_t calcRspSize(const STableMeta* pMeta) {
|
||||||
(numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_FIELD_LEN) +
|
(numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_FIELD_LEN) +
|
||||||
(numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_TYPE_LEN) +
|
(numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_TYPE_LEN) +
|
||||||
(BitmapLen(numOfRows) + numOfRows * sizeof(int32_t)) +
|
(BitmapLen(numOfRows) + numOfRows * sizeof(int32_t)) +
|
||||||
(numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_NOTE_LEN);
|
(numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_NOTE_LEN) +
|
||||||
|
sizeof(int32_t) + sizeof(uint64_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t execDescribe(SNode* pStmt, SRetrieveTableRsp** pRsp) {
|
static int32_t execDescribe(SNode* pStmt, SRetrieveTableRsp** pRsp) {
|
||||||
|
|
|
@ -361,7 +361,7 @@ SOperatorInfo* createGroupOperatorInfo(SOperatorInfo* downstream, SExprInfo* pEx
|
||||||
pOperator->info = pInfo;
|
pOperator->info = pInfo;
|
||||||
pOperator->pTaskInfo = pTaskInfo;
|
pOperator->pTaskInfo = pTaskInfo;
|
||||||
|
|
||||||
createOperatorFpSet(operatorDummyOpenFn, hashGroupbyAggregate, NULL, NULL, destroyGroupOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL);
|
pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, hashGroupbyAggregate, NULL, NULL, destroyGroupOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL);
|
||||||
code = appendDownstream(pOperator, &downstream, 1);
|
code = appendDownstream(pOperator, &downstream, 1);
|
||||||
return pOperator;
|
return pOperator;
|
||||||
|
|
||||||
|
|
|
@ -199,9 +199,9 @@ SOperatorInfo* createDummyOperator(int32_t startVal, int32_t numOfBlocks, int32_
|
||||||
pOperator->name = "dummyInputOpertor4Test";
|
pOperator->name = "dummyInputOpertor4Test";
|
||||||
|
|
||||||
if (numOfCols == 1) {
|
if (numOfCols == 1) {
|
||||||
pOperator->getNextFn = getDummyBlock;
|
pOperator->fpSet.getNextFn = getDummyBlock;
|
||||||
} else {
|
} else {
|
||||||
pOperator->getNextFn = get2ColsDummyBlock;
|
pOperator->fpSet.getNextFn = get2ColsDummyBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDummyInputInfo *pInfo = (SDummyInputInfo*) taosMemoryCalloc(1, sizeof(SDummyInputInfo));
|
SDummyInputInfo *pInfo = (SDummyInputInfo*) taosMemoryCalloc(1, sizeof(SDummyInputInfo));
|
||||||
|
|
Loading…
Reference in New Issue