From 702054c3453a26f63283c6547614c5eb585122e6 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 14 Dec 2022 16:23:49 +0800 Subject: [PATCH] feat(query): add _isfilled pseudocolumn to indicate data is origin or filled. --- include/common/ttypes.h | 1 + source/libs/executor/src/timesliceoperator.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/common/ttypes.h b/include/common/ttypes.h index 6350057c1f..d0f72fbfe5 100644 --- a/include/common/ttypes.h +++ b/include/common/ttypes.h @@ -266,6 +266,7 @@ typedef struct { #define IS_FLOAT_TYPE(_t) ((_t) == TSDB_DATA_TYPE_FLOAT || (_t) == TSDB_DATA_TYPE_DOUBLE) #define IS_INTEGER_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t))) #define IS_TIMESTAMP_TYPE(_t) ((_t) == TSDB_DATA_TYPE_TIMESTAMP) +#define IS_BOOLEAN_TYPE(_t) ((_t) == TSDB_DATA_TYPE_BOOL) #define IS_NUMERIC_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t)) || (IS_FLOAT_TYPE(_t))) #define IS_MATHABLE_TYPE(_t) \ diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index a82dc13318..8db03f99c5 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -163,6 +163,10 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { colDataAppend(pDst, rows, (char*)&pSliceInfo->current, false); continue; + } else if (IS_BOOLEAN_TYPE(pExprInfo->base.resSchema.type)) { + bool isFilled = true; + colDataAppend(pDst, pResBlock->info.rows, (char*)&isFilled, false); + continue; } int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; @@ -274,6 +278,9 @@ static void addCurrentRowToResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp* if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { colDataAppend(pDst, pResBlock->info.rows, (char*)&pSliceInfo->current, false); + } else if (IS_BOOLEAN_TYPE(pExprInfo->base.resSchema.type)) { + bool isFilled = false; + colDataAppend(pDst, pResBlock->info.rows, (char*)&isFilled, false); } else { int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; SColumnInfoData* pSrc = taosArrayGet(pSrcBlock->pDataBlock, srcSlot);