From 8dece648e391966a99112c8c39bc887f0dcce9af Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Thu, 30 Jun 2022 14:48:57 +0800 Subject: [PATCH] feat(tmq): enable withTbName config for snapshot --- source/dnode/vnode/src/tq/tqExec.c | 10 ++++++---- source/dnode/vnode/src/tsdb/tsdbRead.c | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index ac6cc2e411..9cdc3171f5 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -85,10 +85,12 @@ int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, S tqAddBlockDataToRsp(pDataBlock, pRsp); if (pRsp->withTbName) { - // TODO - pRsp->withTbName = 0; - /*int64_t uid = 0;*/ - /*tqAddTbNameToRsp(pTq, uid, pRsp, workerId);*/ + int64_t uid; + int64_t ts; + if (qGetStreamScanStatus(task, &uid, &ts) < 0) { + ASSERT(0); + } + tqAddTbNameToRsp(pTq, uid, pRsp, workerId); } pRsp->blockNum++; diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index e182add5d6..4604e3699f 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -532,9 +532,9 @@ int32_t tsdbSetTableList(tsdbReaderT reader, SArray* tableList) { tsdbReaderT tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* tableList, uint64_t qId, uint64_t taskId) { - /*if (taosArrayGetSize(tableList) == 0) {*/ - /*return NULL;*/ - /*}*/ + if (taosArrayGetSize(tableList) == 0) { + return NULL; + } STsdbReadHandle* pTsdbReadHandle = tsdbQueryTablesImpl(pVnode, pCond, qId, taskId); if (pTsdbReadHandle == NULL) { return NULL;