Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
259b893f
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
259b893f
编写于
11月 30, 2022
作者:
S
slzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: integration test of table count scan
上级
6d86fb5b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
10 deletion
+25
-10
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+23
-8
source/libs/nodes/src/nodesMsgFuncs.c
source/libs/nodes/src/nodesMsgFuncs.c
+2
-2
未找到文件。
source/libs/executor/src/scanoperator.c
浏览文件 @
259b893f
...
...
@@ -3028,7 +3028,7 @@ SOperatorInfo* createTableCountScanOperatorInfo(SReadHandle* readHandle, STableC
int32_t
code
=
TSDB_CODE_SUCCESS
;
SScanPhysiNode
*
pScanNode
=
&
pTblCountScanNode
->
scan
;
STableCountScanOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
STableCountScan
Supp
));
STableCountScanOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
STableCountScan
OperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
if
(
!
pInfo
||
!
pOperator
)
{
...
...
@@ -3082,19 +3082,19 @@ void fillTableCountScanDataBlock(STableCountScanSupp* pSupp, char* dbName, char*
}
if
(
pSupp
->
tbCountSlotId
!=
-
1
)
{
SColumnInfoData
*
colInfoData
=
taosArrayGet
(
pRes
->
pDataBlock
,
pSupp
->
stbName
SlotId
);
SColumnInfoData
*
colInfoData
=
taosArrayGet
(
pRes
->
pDataBlock
,
pSupp
->
tbCount
SlotId
);
colDataAppend
(
colInfoData
,
0
,
(
char
*
)
&
count
,
false
);
}
pRes
->
info
.
rows
=
1
;
}
static
SSDataBlock
*
buildSysDbTableCount
(
STableCountScanOperatorInfo
*
pInfo
)
{
static
SSDataBlock
*
buildSysDbTableCount
(
S
OperatorInfo
*
pOperator
,
S
TableCountScanOperatorInfo
*
pInfo
)
{
STableCountScanSupp
*
pSupp
=
&
pInfo
->
supp
;
SSDataBlock
*
pRes
=
pInfo
->
pRes
;
int64
_t
infodbTableNum
;
size
_t
infodbTableNum
;
getInfosDbMeta
(
NULL
,
&
infodbTableNum
);
int64
_t
perfdbTableNum
;
size
_t
perfdbTableNum
;
getPerfDbMeta
(
NULL
,
&
perfdbTableNum
);
if
(
pSupp
->
groupByDbName
)
{
...
...
@@ -3106,6 +3106,9 @@ static SSDataBlock* buildSysDbTableCount(STableCountScanOperatorInfo* pInfo) {
uint64_t
groupId
=
calcGroupId
(
TSDB_PERFORMANCE_SCHEMA_DB
,
strlen
(
TSDB_PERFORMANCE_SCHEMA_DB
));
pRes
->
info
.
id
.
groupId
=
groupId
;
fillTableCountScanDataBlock
(
pSupp
,
TSDB_PERFORMANCE_SCHEMA_DB
,
""
,
perfdbTableNum
,
pRes
);
}
else
{
setOperatorCompleted
(
pOperator
);
return
NULL
;
}
pInfo
->
currGrpIdx
++
;
return
(
pRes
->
info
.
rows
>
0
)
?
pRes
:
NULL
;
...
...
@@ -3117,6 +3120,7 @@ static SSDataBlock* buildSysDbTableCount(STableCountScanOperatorInfo* pInfo) {
}
else
if
(
strlen
(
pSupp
->
dbName
)
==
0
)
{
fillTableCountScanDataBlock
(
pSupp
,
""
,
""
,
infodbTableNum
+
perfdbTableNum
,
pRes
);
}
setOperatorCompleted
(
pOperator
);
return
(
pRes
->
info
.
rows
>
0
)
?
pRes
:
NULL
;
}
}
...
...
@@ -3131,8 +3135,11 @@ static SSDataBlock* doTableCountScan(SOperatorInfo* pOperator) {
// grouptags high priority(groupid<=>grouptag), then tablename(dbname,tableName).
// scanCols, (grouptags cols)
// mnode, query table count of information_schema and performance_schema
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
NULL
;
}
if
(
pInfo
->
readHandle
.
mnd
!=
NULL
)
{
return
buildSysDbTableCount
(
pInfo
);
return
buildSysDbTableCount
(
p
Operator
,
p
Info
);
}
const
char
*
db
=
NULL
;
...
...
@@ -3173,6 +3180,9 @@ static SSDataBlock* doTableCountScan(SOperatorInfo* pOperator) {
fillTableCountScanDataBlock
(
pSupp
,
dbName
,
stbName
,
ctbNum
,
pRes
);
pInfo
->
currGrpIdx
++
;
}
else
{
setOperatorCompleted
(
pOperator
);
return
NULL
;
}
}
else
{
// group by only db_name
...
...
@@ -3180,6 +3190,7 @@ static SSDataBlock* doTableCountScan(SOperatorInfo* pOperator) {
pRes
->
info
.
id
.
groupId
=
groupId
;
int64_t
dbTableCount
=
metaGetTbNum
(
pInfo
->
readHandle
.
meta
);
fillTableCountScanDataBlock
(
pSupp
,
dbName
,
""
,
dbTableCount
,
pRes
);
setOperatorCompleted
(
pOperator
);
}
}
else
{
if
(
strlen
(
pSupp
->
dbName
)
!=
0
)
{
...
...
@@ -3191,11 +3202,15 @@ static SSDataBlock* doTableCountScan(SOperatorInfo* pOperator) {
fillTableCountScanDataBlock
(
pSupp
,
dbName
,
pSupp
->
stbName
,
ctbNum
,
pRes
);
}
else
{
int64_t
tbNumVnode
=
metaGetTbNum
(
pInfo
->
readHandle
.
meta
);
fillTableCountScanDataBlock
(
pSupp
,
pSupp
->
dbName
,
""
,
tbNumVnode
,
pRes
);
fillTableCountScanDataBlock
(
pSupp
,
dbName
,
""
,
tbNumVnode
,
pRes
);
}
}
else
{
int64_t
tbNumVnode
=
metaGetTbNum
(
pInfo
->
readHandle
.
meta
);
fillTableCountScanDataBlock
(
pSupp
,
dbName
,
""
,
tbNumVnode
,
pRes
);
}
setOperatorCompleted
(
pOperator
);
}
return
pRes
->
info
.
rows
>
0
?
pRes
:
pRes
;
return
pRes
->
info
.
rows
>
0
?
pRes
:
NULL
;
}
static
void
destoryTableCountScanOperator
(
void
*
param
)
{
...
...
source/libs/nodes/src/nodesMsgFuncs.c
浏览文件 @
259b893f
...
...
@@ -3637,10 +3637,10 @@ static int32_t specificNodeToMsg(const void* pObj, STlvEncoder* pEncoder) {
break
;
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN
:
code
=
physiScanNodeToMsg
(
pObj
,
pEncoder
);
break
;
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN
:
code
=
physiLastRowScanNodeToMsg
(
pObj
,
pEncoder
);
break
;
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
...
...
@@ -3776,10 +3776,10 @@ static int32_t msgToSpecificNode(STlvDecoder* pDecoder, void* pObj) {
break
;
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN
:
code
=
msgToPhysiScanNode
(
pDecoder
,
pObj
);
break
;
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN
:
code
=
msgToPhysiLastRowScanNode
(
pDecoder
,
pObj
);
break
;
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录