diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index da4cb62351b7244c050239688df82bf8bd396afe..b7d64d63e9bfbacd34e59c42b33cc6c240442062 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -758,7 +758,7 @@ static int32_t lastDistFuncRequired(SQLFunctionCtx *pCtx, STimeWindow* w, int32_ if (pInfo->hasResult != DATA_SET_FLAG) { return BLK_DATA_ALL_NEEDED; } else { - return (pInfo->ts > w->ekey) ? BLK_DATA_NO_NEEDED : BLK_DATA_ALL_NEEDED; + return (pInfo->ts >= w->ekey) ? BLK_DATA_NO_NEEDED : BLK_DATA_ALL_NEEDED; } }