diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 19a0fbd6296885453e583956fa6b2d2e2aebcfff..0ac5f0d8ff6dbb538ac7d13f0c91bb17d1358204 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -706,20 +706,20 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma // TODO: the schema update should be handled later(TD-17965) if (buildSubmitReqFromDataBlock(&pReq, output, pTSchema, SMA_VID(pSma), suid) < 0) { - smaError("vgId:%d, build submit req for rsma table %" PRIi64 " level %" PRIi8 " failed since %s", SMA_VID(pSma), - suid, pItem->level, terrstr()); + smaError("vgId:%d, build submit req for rsma table suid:%" PRIu64 ", uid:%"PRIu64", level %" PRIi8 " failed since %s", SMA_VID(pSma), + suid, output->info.groupId, pItem->level, terrstr()); goto _err; } if (pReq && tdProcessSubmitReq(sinkTsdb, output->info.version, pReq) < 0) { taosMemoryFreeClear(pReq); - smaError("vgId:%d, process submit req for rsma table %" PRIi64 " level %" PRIi8 " failed since %s", - SMA_VID(pSma), suid, pItem->level, terrstr()); + smaError("vgId:%d, process submit req for rsma table suid:%" PRIu64 ", uid:%"PRIu64", level %" PRIi8 " failed since %s", + SMA_VID(pSma), suid, output->info.groupId, pItem->level, terrstr()); goto _err; } - smaDebug("vgId:%d, process submit req for rsma table %" PRIi64 " level %" PRIi8 " ver %" PRIi64 " len %" PRIu32, - SMA_VID(pSma), suid, pItem->level, output->info.version, htonl(pReq->header.contLen)); + smaDebug("vgId:%d, process submit req for rsma table suid:%" PRIu64 ", uid:%"PRIu64", level %" PRIi8 " ver %" PRIi64 " len %" PRIu32, + SMA_VID(pSma), suid, output->info.groupId, pItem->level, output->info.version, htonl(pReq->header.contLen)); taosMemoryFreeClear(pReq); } diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index dbef0320419431c9da67de833e9627d896256a45..6bce88fa230df26f9d8cf08eeb9aebdc99866fc7 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -1679,11 +1679,15 @@ uint64_t getTableGroupId(const STableListInfo* pTableList, uint64_t tableUid) { int32_t addTableIntoTableList(STableListInfo* pTableList, uint64_t uid, uint64_t gid) { STableKeyInfo keyInfo = {.uid = uid, .groupId = gid}; - taosArrayPush(pTableList->pTableList, &keyInfo); - if (pTableList->oneTableForEachGroup || pTableList->numOfOuputGroups > 1) { + if (!pTableList->oneTableForEachGroup) { + if (pTableList->map == NULL) { + pTableList->map = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); + } + taosHashPut(pTableList->map, &uid, sizeof(uid), &keyInfo.groupId, sizeof(keyInfo.groupId)); } + return TSDB_CODE_SUCCESS; }