feat(query): interp support return timestamp with pseudo column _irowts
TD-18842
This commit is contained in:
parent
e72dceea30
commit
5738ba08dc
|
@ -2095,12 +2095,17 @@ static void genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
|
||||||
bool hasInterp = true;
|
bool hasInterp = true;
|
||||||
for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) {
|
for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) {
|
||||||
SExprInfo* pExprInfo = &pExprSup->pExprInfo[j];
|
SExprInfo* pExprInfo = &pExprSup->pExprInfo[j];
|
||||||
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
|
||||||
int32_t dstSlot = pExprInfo->base.resSchema.slotId;
|
|
||||||
|
|
||||||
// SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot);
|
int32_t dstSlot = pExprInfo->base.resSchema.slotId;
|
||||||
SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot);
|
SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot);
|
||||||
|
|
||||||
|
if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) {
|
||||||
|
colDataAppend(pDst, rows, (char*)&pSliceInfo->current, false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
||||||
|
// SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot);
|
||||||
switch (pSliceInfo->fillType) {
|
switch (pSliceInfo->fillType) {
|
||||||
case TSDB_FILL_NULL: {
|
case TSDB_FILL_NULL: {
|
||||||
colDataAppendNULL(pDst, rows);
|
colDataAppendNULL(pDst, rows);
|
||||||
|
@ -2346,12 +2351,16 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) {
|
||||||
if (ts == pSliceInfo->current) {
|
if (ts == pSliceInfo->current) {
|
||||||
for (int32_t j = 0; j < pOperator->exprSupp.numOfExprs; ++j) {
|
for (int32_t j = 0; j < pOperator->exprSupp.numOfExprs; ++j) {
|
||||||
SExprInfo* pExprInfo = &pOperator->exprSupp.pExprInfo[j];
|
SExprInfo* pExprInfo = &pOperator->exprSupp.pExprInfo[j];
|
||||||
int32_t dstSlot = pExprInfo->base.resSchema.slotId;
|
|
||||||
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
|
||||||
|
|
||||||
SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot);
|
int32_t dstSlot = pExprInfo->base.resSchema.slotId;
|
||||||
SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot);
|
SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot);
|
||||||
|
|
||||||
|
if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) {
|
||||||
|
colDataAppend(pDst, pResBlock->info.rows, (char *)&pSliceInfo->current, false);
|
||||||
|
} else {
|
||||||
|
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
||||||
|
SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot);
|
||||||
|
|
||||||
if (colDataIsNull_s(pSrc, i)) {
|
if (colDataIsNull_s(pSrc, i)) {
|
||||||
colDataAppendNULL(pDst, pResBlock->info.rows);
|
colDataAppendNULL(pDst, pResBlock->info.rows);
|
||||||
continue;
|
continue;
|
||||||
|
@ -2360,6 +2369,7 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) {
|
||||||
char* v = colDataGetData(pSrc, i);
|
char* v = colDataGetData(pSrc, i);
|
||||||
colDataAppend(pDst, pResBlock->info.rows, v, false);
|
colDataAppend(pDst, pResBlock->info.rows, v, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pResBlock->info.rows += 1;
|
pResBlock->info.rows += 1;
|
||||||
doKeepPrevRows(pSliceInfo, pBlock, i);
|
doKeepPrevRows(pSliceInfo, pBlock, i);
|
||||||
|
@ -2478,15 +2488,25 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) {
|
||||||
if (ts == pSliceInfo->current && pSliceInfo->current <= pSliceInfo->win.ekey) {
|
if (ts == pSliceInfo->current && pSliceInfo->current <= pSliceInfo->win.ekey) {
|
||||||
for (int32_t j = 0; j < pOperator->exprSupp.numOfExprs; ++j) {
|
for (int32_t j = 0; j < pOperator->exprSupp.numOfExprs; ++j) {
|
||||||
SExprInfo* pExprInfo = &pOperator->exprSupp.pExprInfo[j];
|
SExprInfo* pExprInfo = &pOperator->exprSupp.pExprInfo[j];
|
||||||
int32_t dstSlot = pExprInfo->base.resSchema.slotId;
|
|
||||||
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
|
||||||
|
|
||||||
SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot);
|
int32_t dstSlot = pExprInfo->base.resSchema.slotId;
|
||||||
SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot);
|
SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot);
|
||||||
|
|
||||||
|
if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) {
|
||||||
|
colDataAppend(pDst, pResBlock->info.rows, (char *)&pSliceInfo->current, false);
|
||||||
|
} else {
|
||||||
|
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
||||||
|
SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot);
|
||||||
|
|
||||||
|
if (colDataIsNull_s(pSrc, i)) {
|
||||||
|
colDataAppendNULL(pDst, pResBlock->info.rows);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
char* v = colDataGetData(pSrc, i);
|
char* v = colDataGetData(pSrc, i);
|
||||||
colDataAppend(pDst, pResBlock->info.rows, v, false);
|
colDataAppend(pDst, pResBlock->info.rows, v, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pResBlock->info.rows += 1;
|
pResBlock->info.rows += 1;
|
||||||
doKeepPrevRows(pSliceInfo, pBlock, i);
|
doKeepPrevRows(pSliceInfo, pBlock, i);
|
||||||
|
|
Loading…
Reference in New Issue