fix(tsdb): set pk column index.
This commit is contained in:
parent
1d77cde433
commit
b12e65d144
|
@ -1037,6 +1037,7 @@ typedef struct {
|
||||||
uint8_t scale;
|
uint8_t scale;
|
||||||
int32_t bytes;
|
int32_t bytes;
|
||||||
int8_t type;
|
int8_t type;
|
||||||
|
uint8_t pk;
|
||||||
} SColumnInfo;
|
} SColumnInfo;
|
||||||
|
|
||||||
typedef struct STimeWindow {
|
typedef struct STimeWindow {
|
||||||
|
|
|
@ -129,6 +129,10 @@ static int32_t setColumnIdSlotList(SBlockLoadSuppInfo* pSupInfo, SColumnInfo* pC
|
||||||
} else {
|
} else {
|
||||||
pSupInfo->buildBuf[i] = NULL;
|
pSupInfo->buildBuf[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pCols[i].pk) {
|
||||||
|
pSupInfo->pkSlotId = pCols[i].slotId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
|
|
@ -159,6 +159,7 @@ typedef struct SBlockLoadSuppInfo {
|
||||||
int16_t* slotId;
|
int16_t* slotId;
|
||||||
int32_t numOfCols;
|
int32_t numOfCols;
|
||||||
char** buildBuf; // build string tmp buffer, todo remove it later after all string format being updated.
|
char** buildBuf; // build string tmp buffer, todo remove it later after all string format being updated.
|
||||||
|
int16_t pkSlotId;
|
||||||
bool smaValid; // the sma on all queried columns are activated
|
bool smaValid; // the sma on all queried columns are activated
|
||||||
} SBlockLoadSuppInfo;
|
} SBlockLoadSuppInfo;
|
||||||
|
|
||||||
|
|
|
@ -370,7 +370,8 @@ static EDealRes getColumn(SNode** pNode, void* pContext) {
|
||||||
pSColumnNode->slotId = pData->index++;
|
pSColumnNode->slotId = pData->index++;
|
||||||
SColumnInfo cInfo = {.colId = pSColumnNode->colId,
|
SColumnInfo cInfo = {.colId = pSColumnNode->colId,
|
||||||
.type = pSColumnNode->node.resType.type,
|
.type = pSColumnNode->node.resType.type,
|
||||||
.bytes = pSColumnNode->node.resType.bytes};
|
.bytes = pSColumnNode->node.resType.bytes,
|
||||||
|
.pk = pSColumnNode->isPk};
|
||||||
#if TAG_FILTER_DEBUG
|
#if TAG_FILTER_DEBUG
|
||||||
qDebug("tagfilter build column info, slotId:%d, colId:%d, type:%d", pSColumnNode->slotId, cInfo.colId, cInfo.type);
|
qDebug("tagfilter build column info, slotId:%d, colId:%d, type:%d", pSColumnNode->slotId, cInfo.colId, cInfo.type);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1763,6 +1764,7 @@ int32_t initQueryTableDataCond(SQueryTableDataCond* pCond, const STableScanPhysi
|
||||||
pCond->colList[j].type = pColNode->node.resType.type;
|
pCond->colList[j].type = pColNode->node.resType.type;
|
||||||
pCond->colList[j].bytes = pColNode->node.resType.bytes;
|
pCond->colList[j].bytes = pColNode->node.resType.bytes;
|
||||||
pCond->colList[j].colId = pColNode->colId;
|
pCond->colList[j].colId = pColNode->colId;
|
||||||
|
pCond->colList[j].pk = pColNode->isPk;
|
||||||
|
|
||||||
pCond->pSlotList[j] = pNode->slotId;
|
pCond->pSlotList[j] = pNode->slotId;
|
||||||
j += 1;
|
j += 1;
|
||||||
|
|
|
@ -2276,6 +2276,7 @@ static int32_t initTableblockDistQueryCond(uint64_t uid, SQueryTableDataCond* pC
|
||||||
pCond->colList->colId = 1;
|
pCond->colList->colId = 1;
|
||||||
pCond->colList->type = TSDB_DATA_TYPE_TIMESTAMP;
|
pCond->colList->type = TSDB_DATA_TYPE_TIMESTAMP;
|
||||||
pCond->colList->bytes = sizeof(TSKEY);
|
pCond->colList->bytes = sizeof(TSKEY);
|
||||||
|
pCond->colList->pk = 0;
|
||||||
|
|
||||||
pCond->pSlotList[0] = 0;
|
pCond->pSlotList[0] = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue