fix: set primary key target slot id through searching scan cols and find colId that equals primary key id
This commit is contained in:
parent
312dce4e21
commit
414b27fb6a
|
@ -2621,11 +2621,19 @@ static SSDataBlock* getTableDataBlock(void* param) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SArray* generateSortByTsInfo(int32_t order) {
|
||||
SArray* generateSortByTsInfo(SArray* colMatchInfo, int32_t order) {
|
||||
int32_t tsTargetSlotId = 0;
|
||||
for (int32_t i = 0; i < taosArrayGetSize(colMatchInfo); ++i) {
|
||||
SColMatchInfo* colInfo = taosArrayGet(colMatchInfo, i);
|
||||
if (colInfo->colId == PRIMARYKEY_TIMESTAMP_COL_ID) {
|
||||
tsTargetSlotId = colInfo->targetSlotId;
|
||||
}
|
||||
}
|
||||
|
||||
SArray* pList = taosArrayInit(1, sizeof(SBlockOrderInfo));
|
||||
SBlockOrderInfo bi = {0};
|
||||
bi.order = order;
|
||||
bi.slotId = 0;
|
||||
bi.slotId = tsTargetSlotId;
|
||||
bi.nullFirst = NULL_ORDER_FIRST;
|
||||
|
||||
taosArrayPush(pList, &bi);
|
||||
|
@ -2874,7 +2882,7 @@ SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanN
|
|||
|
||||
pInfo->sortSourceParams = taosArrayInit(64, sizeof(STableMergeScanSortSourceParam));
|
||||
|
||||
pInfo->pSortInfo = generateSortByTsInfo(pInfo->cond.order);
|
||||
pInfo->pSortInfo = generateSortByTsInfo(pInfo->pColMatchInfo, pInfo->cond.order);
|
||||
pInfo->pSortInputBlock = createOneDataBlock(pInfo->pResBlock, false);
|
||||
|
||||
int32_t rowSize = pInfo->pResBlock->info.rowSize;
|
||||
|
|
|
@ -225,6 +225,8 @@ const char* nodesNodeName(ENodeType type) {
|
|||
return "PhysiBlockDistScan";
|
||||
case QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN:
|
||||
return "PhysiLastRowScan";
|
||||
case QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN:
|
||||
return "PhysiTableMergeScan";
|
||||
case QUERY_NODE_PHYSICAL_PLAN_PROJECT:
|
||||
return "PhysiProject";
|
||||
case QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN:
|
||||
|
|
Loading…
Reference in New Issue