From cbacd1fd4578570836657a8332478dfad5f2e0a0 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Thu, 23 Jun 2022 15:35:19 +0800 Subject: [PATCH] fix: fix empty downstream input for group sort operator --- source/libs/executor/src/sortoperator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c index 6086138301..24016c3338 100644 --- a/source/libs/executor/src/sortoperator.c +++ b/source/libs/executor/src/sortoperator.c @@ -387,6 +387,10 @@ SSDataBlock* doGroupSort(SOperatorInfo* pOperator) { pInfo->hasGroupId = true; pInfo->prefetchedSortInput = pOperator->pDownstream[0]->fpSet.getNextFn(pOperator->pDownstream[0]); + if (pInfo->prefetchedSortInput == NULL) { + doSetOperatorCompleted(pOperator); + return NULL; + } pInfo->currGroupId = pInfo->prefetchedSortInput->info.groupId; pInfo->childOpStatus = CHILD_OP_NEW_GROUP; beginSortGroup(pOperator); -- GitLab