Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
add5ff5b
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
add5ff5b
编写于
1月 27, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/3.0_liaohj' into feature/tq
上级
8d710801
cfc83751
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
41 addition
and
47 deletion
+41
-47
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+0
-1
source/dnode/vnode/inc/tsdb.h
source/dnode/vnode/inc/tsdb.h
+1
-1
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+2
-2
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+9
-15
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+29
-28
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
add5ff5b
#include "../../libs/scheduler/inc/schedulerInt.h"
#include "clientInt.h"
#include "clientLog.h"
#include "parser.h"
...
...
source/dnode/vnode/inc/tsdb.h
浏览文件 @
add5ff5b
...
...
@@ -220,7 +220,7 @@ int32_t tsdbGetTableGroupFromIdList(STsdb *tsdb, SArray *pTableIdList, STableGro
* clean up the query handle
* @param queryHandle
*/
void
tsdbCleanup
Query
Handle
(
tsdbReadHandleT
queryHandle
);
void
tsdbCleanup
Read
Handle
(
tsdbReadHandleT
queryHandle
);
#ifdef __cplusplus
}
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
add5ff5b
...
...
@@ -208,8 +208,8 @@ static FORCE_INLINE void tqReadHandleSetColIdList(STqReadHandle* pReadHandle, SA
pReadHandle
->
pColIdList
=
pColIdList
;
}
static
FORCE_INLINE
void
tqReadHandleSetTbUid
(
STqReadHandle
*
pHandle
,
uint64_t
tbUid
)
{
pHandle
->
tbUid
=
tbUid
;
static
FORCE_INLINE
void
tqReadHandleSetTbUid
(
STqReadHandle
*
pHandle
,
const
SArray
*
pTableIdList
)
{
// pHandle->tbUid = pTableIdList
;
}
static
FORCE_INLINE
int
tqReadHandleSetTbUidList
(
STqReadHandle
*
pHandle
,
SArray
*
tbUidList
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
add5ff5b
...
...
@@ -427,7 +427,7 @@ static STsdbReadHandle* tsdbQueryTablesImpl(STsdb* tsdb, STsdbQueryCond* pCond,
return
(
tsdbReadHandleT
)
pReadHandle
;
_end:
tsdbCleanup
Query
Handle
(
pReadHandle
);
tsdbCleanup
Read
Handle
(
pReadHandle
);
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
NULL
;
}
...
...
@@ -445,7 +445,7 @@ tsdbReadHandleT* tsdbQueryTables(STsdb* tsdb, STsdbQueryCond* pCond, STableGroup
// todo apply the lastkey of table check to avoid to load header file
pTsdbReadHandle
->
pTableCheckInfo
=
createCheckInfoFromTableGroup
(
pTsdbReadHandle
,
groupList
);
if
(
pTsdbReadHandle
->
pTableCheckInfo
==
NULL
)
{
// tsdbCleanup
Query
Handle(pTsdbReadHandle);
// tsdbCleanup
Read
Handle(pTsdbReadHandle);
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
NULL
;
}
...
...
@@ -525,7 +525,7 @@ void tsdbResetQueryHandleForNewTable(tsdbReadHandleT queryHandle, STsdbQueryCond
pTsdbReadHandle
->
pTableCheckInfo
=
NULL
;
//createCheckInfoFromTableGroup(pTsdbReadHandle, groupList, pMeta, &pTable);
if
(
pTsdbReadHandle
->
pTableCheckInfo
==
NULL
)
{
// tsdbCleanup
Query
Handle(pTsdbReadHandle);
// tsdbCleanup
Read
Handle(pTsdbReadHandle);
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
}
...
...
@@ -3051,7 +3051,7 @@ bool tsdbNextDataBlock(tsdbReadHandleT pHandle) {
// }
//
//out_of_memory:
// tsdbCleanup
Query
Handle(pSecQueryHandle);
// tsdbCleanup
Read
Handle(pSecQueryHandle);
// return terrno;
//}
...
...
@@ -3722,26 +3722,19 @@ int32_t tsdbQuerySTableByTagCond(STsdb* tsdb, uint64_t uid, TSKEY skey, const ch
return
terrno
;
}
#if 0
int32_t
tsdbGetOneTableGroup
(
STsdb
*
tsdb
,
uint64_t
uid
,
TSKEY
startKey
,
STableGroupInfo
*
pGroupInfo
)
{
if (tsdbRLockRepoMeta(tsdb) < 0) goto _error;
STable* pTable = tsdbGetTableByUid(tsdbGetMeta(tsdb), uid);
if (pTable == NULL) {
STbCfg
*
pTbCfg
=
metaGetTbInfoByUid
(
tsdb
->
pMeta
,
uid
);
if
(
pTbCfg
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_INVALID_TABLE_ID
;
tsdbUnlockRepoMeta(tsdb);
goto
_error
;
}
assert(pTable->type == TSDB_CHILD_TABLE || pTable->type == TSDB_NORMAL_TABLE || pTable->type == TSDB_STREAM_TABLE);
if (tsdbUnlockRepoMeta(tsdb) < 0) goto _error;
pGroupInfo
->
numOfTables
=
1
;
pGroupInfo
->
pGroupList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SArray
*
group
=
taosArrayInit
(
1
,
sizeof
(
STableKeyInfo
));
STableKeyInfo info = {.
pTable = pTable, .lastKey = startKey
};
STableKeyInfo
info
=
{.
lastKey
=
startKey
,
.
uid
=
uid
};
taosArrayPush
(
group
,
&
info
);
taosArrayPush
(
pGroupInfo
->
pGroupList
,
&
group
);
...
...
@@ -3751,6 +3744,7 @@ int32_t tsdbGetOneTableGroup(STsdb* tsdb, uint64_t uid, TSKEY startKey, STableGr
return
terrno
;
}
#if 0
int32_t tsdbGetTableGroupFromIdList(STsdb* tsdb, SArray* pTableIdList, STableGroupInfo* pGroupInfo) {
if (tsdbRLockRepoMeta(tsdb) < 0) {
return terrno;
...
...
@@ -3826,7 +3820,7 @@ static void* destroyTableCheckInfo(SArray* pTableCheckInfo) {
}
void
tsdbCleanup
Query
Handle
(
tsdbReadHandleT
queryHandle
)
{
void
tsdbCleanup
Read
Handle
(
tsdbReadHandleT
queryHandle
)
{
STsdbReadHandle
*
pTsdbReadHandle
=
(
STsdbReadHandle
*
)
queryHandle
;
if
(
pTsdbReadHandle
==
NULL
)
{
return
;
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
add5ff5b
...
...
@@ -2371,7 +2371,7 @@ _clean:
static
void
doFreeQueryHandle
(
STaskRuntimeEnv
*
pRuntimeEnv
)
{
STaskAttr
*
pQueryAttr
=
pRuntimeEnv
->
pQueryAttr
;
// tsdbCleanup
Query
Handle(pRuntimeEnv->pTsdbReadHandle);
// tsdbCleanup
Read
Handle(pRuntimeEnv->pTsdbReadHandle);
pRuntimeEnv
->
pTsdbReadHandle
=
NULL
;
// SMemRef* pMemRef = &pQueryAttr->memRef;
...
...
@@ -5454,7 +5454,7 @@ SOperatorInfo* createTableBlockInfoScanOperator(void* pTsdbReadHandle, STaskRunt
return
pOperator
;
}
SOperatorInfo
*
createStreamScanOperatorInfo
(
void
*
streamReadHandle
,
SArray
*
pExprInfo
,
uint64_t
uid
,
SExecTaskInfo
*
pTaskInfo
)
{
SOperatorInfo
*
createStreamScanOperatorInfo
(
void
*
streamReadHandle
,
SArray
*
pExprInfo
,
SArray
*
pTableIdList
,
SExecTaskInfo
*
pTaskInfo
)
{
SStreamBlockScanInfo
*
pInfo
=
calloc
(
1
,
sizeof
(
SStreamBlockScanInfo
));
SOperatorInfo
*
pOperator
=
calloc
(
1
,
sizeof
(
SOperatorInfo
));
if
(
pInfo
==
NULL
||
pOperator
==
NULL
)
{
...
...
@@ -5477,7 +5477,7 @@ SOperatorInfo* createStreamScanOperatorInfo(void *streamReadHandle, SArray* pExp
// set the extract column id to streamHandle
tqReadHandleSetColIdList
((
STqReadHandle
*
)
streamReadHandle
,
pColList
);
tqReadHandleSetTbUid
(
streamReadHandle
,
uid
);
tqReadHandleSetTbUid
(
streamReadHandle
,
pTableIdList
);
pInfo
->
readerHandle
=
streamReadHandle
;
...
...
@@ -7750,6 +7750,7 @@ static SExecTaskInfo* createExecTaskInfo(uint64_t queryId, uint64_t taskId) {
}
static
tsdbReadHandleT
doCreateDataReadHandle
(
STableScanPhyNode
*
pTableScanNode
,
void
*
readerHandle
,
uint64_t
queryId
,
uint64_t
taskId
);
static
int32_t
doCreateTableGroup
(
void
*
readerHandle
,
int32_t
tableType
,
uint64_t
tableUid
,
STableGroupInfo
*
pGroupInfo
,
uint64_t
queryId
,
uint64_t
taskId
);
SOperatorInfo
*
doCreateOperatorTreeNode
(
SPhyNode
*
pPhyNode
,
SExecTaskInfo
*
pTaskInfo
,
void
*
readerHandle
,
uint64_t
queryId
,
uint64_t
taskId
)
{
if
(
pPhyNode
->
pChildren
==
NULL
||
taosArrayGetSize
(
pPhyNode
->
pChildren
)
==
0
)
{
...
...
@@ -7773,7 +7774,12 @@ SOperatorInfo* doCreateOperatorTreeNode(SPhyNode* pPhyNode, SExecTaskInfo* pTask
return
createExchangeOperatorInfo
(
pEx
->
pSrcEndPoints
,
pEx
->
node
.
pTargets
,
pTaskInfo
);
}
else
if
(
pPhyNode
->
info
.
type
==
OP_StreamScan
)
{
SScanPhyNode
*
pScanPhyNode
=
(
SScanPhyNode
*
)
pPhyNode
;
// simple child table.
return
createStreamScanOperatorInfo
(
readerHandle
,
pPhyNode
->
pTargets
,
pScanPhyNode
->
uid
,
pTaskInfo
);
STableGroupInfo
groupInfo
=
{
0
};
int32_t
code
=
doCreateTableGroup
(
readerHandle
,
pScanPhyNode
->
tableType
,
pScanPhyNode
->
uid
,
&
groupInfo
,
queryId
,
taskId
);
SArray
*
pa
=
taosArrayGetP
(
groupInfo
.
pGroupList
,
0
);
ASSERT
(
taosArrayGetSize
(
groupInfo
.
pGroupList
)
==
1
);
return
createStreamScanOperatorInfo
(
readerHandle
,
pPhyNode
->
pTargets
,
pa
,
pTaskInfo
);
}
}
...
...
@@ -7811,30 +7817,25 @@ static tsdbReadHandleT createDataReadHandle(STableScanPhyNode* pTableScanNode, S
return
tsdbQueryTables
(
readerHandle
,
&
cond
,
pGroupInfo
,
queryId
,
taskId
);
}
static
tsdbReadHandleT
doCreateDataReadHandle
(
STableScanPhyNode
*
pTableScanNode
,
void
*
readerHandle
,
uint64_t
queryId
,
uint64_t
taskId
)
{
static
int32_t
doCreateTableGroup
(
void
*
readerHandle
,
int32_t
tableType
,
uint64_t
tableUid
,
STableGroupInfo
*
pGroupInfo
,
uint64_t
queryId
,
uint64_t
taskId
)
{
int32_t
code
=
0
;
if
(
tableType
==
TSDB_SUPER_TABLE
)
{
code
=
tsdbQuerySTableByTagCond
(
readerHandle
,
tableUid
,
0
,
NULL
,
0
,
0
,
NULL
,
pGroupInfo
,
NULL
,
0
,
queryId
,
taskId
);
}
else
{
// Create one table group.
code
=
tsdbGetOneTableGroup
(
readerHandle
,
tableUid
,
0
,
pGroupInfo
);
}
return
code
;
}
static
tsdbReadHandleT
doCreateDataReadHandle
(
STableScanPhyNode
*
pTableScanNode
,
void
*
readerHandle
,
uint64_t
queryId
,
uint64_t
taskId
)
{
STableGroupInfo
groupInfo
=
{
0
};
uint64_t
uid
=
pTableScanNode
->
scan
.
uid
;
STimeWindow
window
=
pTableScanNode
->
window
;
int32_t
tableType
=
pTableScanNode
->
scan
.
tableType
;
if
(
tableType
==
TSDB_SUPER_TABLE
)
{
code
=
tsdbQuerySTableByTagCond
(
readerHandle
,
uid
,
window
.
skey
,
NULL
,
0
,
0
,
NULL
,
&
groupInfo
,
NULL
,
0
,
queryId
,
taskId
);
int32_t
code
=
doCreateTableGroup
(
readerHandle
,
pTableScanNode
->
scan
.
tableType
,
uid
,
&
groupInfo
,
queryId
,
taskId
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
}
}
else
{
// Create one table group.
groupInfo
.
numOfTables
=
1
;
groupInfo
.
pGroupList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SArray
*
pa
=
taosArrayInit
(
1
,
sizeof
(
STableKeyInfo
));
STableKeyInfo
info
=
{.
lastKey
=
0
,
.
uid
=
uid
};
taosArrayPush
(
pa
,
&
info
);
taosArrayPush
(
groupInfo
.
pGroupList
,
&
pa
);
}
if
(
groupInfo
.
numOfTables
==
0
)
{
code
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录