Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4ed26bbc
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看板
提交
4ed26bbc
编写于
4月 17, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): update the table list api.
上级
eb7f510c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
29 deletion
+29
-29
source/libs/executor/inc/executil.h
source/libs/executor/inc/executil.h
+1
-1
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+25
-26
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+3
-2
未找到文件。
source/libs/executor/inc/executil.h
浏览文件 @
4ed26bbc
...
...
@@ -108,7 +108,7 @@ uint64_t tableListGetSize(const STableListInfo* pTableList);
uint64_t
tableListGetSuid
(
const
STableListInfo
*
pTableList
);
STableKeyInfo
*
tableListGetInfo
(
const
STableListInfo
*
pTableList
,
int32_t
index
);
int32_t
tableListFind
(
const
STableListInfo
*
pTableList
,
uint64_t
uid
,
int32_t
startIndex
);
void
tableListGetSourceTableInfo
(
const
STableListInfo
*
pTableList
,
uint64_t
*
psuid
,
int32_t
*
type
);
void
tableListGetSourceTableInfo
(
const
STableListInfo
*
pTableList
,
uint64_t
*
psuid
,
uint64_t
*
uid
,
int32_t
*
type
);
size_t
getResultRowSize
(
struct
SqlFunctionCtx
*
pCtx
,
int32_t
numOfOutput
);
void
initResultRowInfo
(
SResultRowInfo
*
pResultRowInfo
);
...
...
source/libs/executor/src/executil.c
浏览文件 @
4ed26bbc
...
...
@@ -27,19 +27,21 @@
#include "executorimpl.h"
#include "tcompression.h"
typedef
struct
STableListIdInfo
{
uint64_t
suid
;
uint64_t
uid
;
int32_t
tableType
;
}
STableListIdInfo
;
// If the numOfOutputGroups is 1, the data blocks that belongs to different groups will be provided randomly
// The numOfOutputGroups is specified by physical plan. and will not be affect by numOfGroups
struct
STableListInfo
{
bool
oneTableForEachGroup
;
int32_t
numOfOuputGroups
;
// the data block will be generated one by one
int32_t
*
groupOffset
;
// keep the offset value for each group in the tableList
SArray
*
pTableList
;
SHashObj
*
map
;
// speedup acquire the tableQueryInfo by table uid
union
{
uint64_t
suid
;
uint64_t
uid
;
};
// this maybe the super table or ordinary table
int32_t
tableType
;
// queried table type
bool
oneTableForEachGroup
;
int32_t
numOfOuputGroups
;
// the data block will be generated one by one
int32_t
*
groupOffset
;
// keep the offset value for each group in the tableList
SArray
*
pTableList
;
SHashObj
*
map
;
// speedup acquire the tableQueryInfo by table uid
STableListIdInfo
idInfo
;
// this maybe the super table or ordinary table
};
typedef
struct
tagFilterAssist
{
...
...
@@ -474,7 +476,7 @@ int32_t getColInfoResultForGroupby(void* metaHandle, SNodeList* group, STableLis
}
// int64_t stt = taosGetTimestampUs();
code
=
metaGetTableTags
(
metaHandle
,
pTableListInfo
->
suid
,
pUidTagList
);
code
=
metaGetTableTags
(
metaHandle
,
pTableListInfo
->
idInfo
.
suid
,
pUidTagList
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
end
;
}
...
...
@@ -957,7 +959,7 @@ static int32_t doFilterByTagCond(STableListInfo* pListInfo, SArray* pUidList, SN
FilterCondType
condType
=
checkTagCond
(
pTagCond
);
int32_t
filter
=
optimizeTbnameInCond
(
metaHandle
,
pListInfo
->
suid
,
pUidTagList
,
pTagCond
);
int32_t
filter
=
optimizeTbnameInCond
(
metaHandle
,
pListInfo
->
idInfo
.
suid
,
pUidTagList
,
pTagCond
);
if
(
filter
==
0
)
{
// tbname in filter is activated, do nothing and return
taosArrayClear
(
pUidList
);
...
...
@@ -970,12 +972,12 @@ static int32_t doFilterByTagCond(STableListInfo* pListInfo, SArray* pUidList, SN
terrno
=
0
;
}
else
{
if
((
condType
==
FILTER_NO_LOGIC
||
condType
==
FILTER_AND
)
&&
status
!=
SFLT_NOT_INDEX
)
{
code
=
metaGetTableTagsByUids
(
metaHandle
,
pListInfo
->
suid
,
pUidTagList
);
code
=
metaGetTableTagsByUids
(
metaHandle
,
pListInfo
->
idInfo
.
suid
,
pUidTagList
);
}
else
{
code
=
metaGetTableTags
(
metaHandle
,
pListInfo
->
suid
,
pUidTagList
);
code
=
metaGetTableTags
(
metaHandle
,
pListInfo
->
idInfo
.
suid
,
pUidTagList
);
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get table tags from meta, reason:%s, suid:%"
PRIu64
,
tstrerror
(
code
),
pListInfo
->
suid
);
qError
(
"failed to get table tags from meta, reason:%s, suid:%"
PRIu64
,
tstrerror
(
code
),
pListInfo
->
idInfo
.
suid
);
terrno
=
code
;
goto
end
;
}
...
...
@@ -1029,14 +1031,14 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
int32_t
code
=
TSDB_CODE_SUCCESS
;
size_t
numOfTables
=
0
;
pListInfo
->
suid
=
pScanNode
->
suid
;
pListInfo
->
tableType
=
pScanNode
->
tableType
;
pListInfo
->
idInfo
.
suid
=
pScanNode
->
suid
;
pListInfo
->
idInfo
.
tableType
=
pScanNode
->
tableType
;
SArray
*
pUidList
=
taosArrayInit
(
8
,
sizeof
(
uint64_t
));
SIdxFltStatus
status
=
SFLT_NOT_INDEX
;
if
(
pScanNode
->
tableType
!=
TSDB_SUPER_TABLE
)
{
pListInfo
->
uid
=
pScanNode
->
uid
;
pListInfo
->
idInfo
.
uid
=
pScanNode
->
uid
;
if
(
metaIsTableExist
(
metaHandle
,
pScanNode
->
uid
))
{
taosArrayPush
(
pUidList
,
&
pScanNode
->
uid
);
}
...
...
@@ -1801,11 +1803,7 @@ uint64_t tableListGetSize(const STableListInfo* pTableList) {
}
uint64_t
tableListGetSuid
(
const
STableListInfo
*
pTableList
)
{
if
(
pTableList
->
tableType
==
TSDB_SUPER_TABLE
)
{
return
pTableList
->
suid
;
}
else
{
// query normal table, no suid exists.
return
0
;
}
return
pTableList
->
idInfo
.
suid
;
}
STableKeyInfo
*
tableListGetInfo
(
const
STableListInfo
*
pTableList
,
int32_t
index
)
{
...
...
@@ -1831,9 +1829,10 @@ int32_t tableListFind(const STableListInfo* pTableList, uint64_t uid, int32_t st
return
-
1
;
}
void
tableListGetSourceTableInfo
(
const
STableListInfo
*
pTableList
,
uint64_t
*
psuid
,
int32_t
*
type
)
{
*
psuid
=
pTableList
->
suid
;
*
type
=
pTableList
->
tableType
;
void
tableListGetSourceTableInfo
(
const
STableListInfo
*
pTableList
,
uint64_t
*
psuid
,
uint64_t
*
uid
,
int32_t
*
type
)
{
*
psuid
=
pTableList
->
idInfo
.
suid
;
*
uid
=
pTableList
->
idInfo
.
uid
;
*
type
=
pTableList
->
idInfo
.
tableType
;
}
uint64_t
getTableGroupId
(
const
STableListInfo
*
pTableList
,
uint64_t
tableUid
)
{
...
...
source/libs/executor/src/executor.c
浏览文件 @
4ed26bbc
...
...
@@ -330,9 +330,10 @@ static SArray* filterUnqualifiedTables(const SStreamScanInfo* pScanInfo, const S
STableScanInfo
*
pTableScanInfo
=
pScanInfo
->
pTableScanOp
->
info
;
uint64_t
suid
=
0
;
uint64_t
uid
=
0
;
int32_t
type
=
0
;
tableListGetSourceTableInfo
(
pTableScanInfo
->
base
.
pTableListInfo
,
&
uid
,
&
type
);
tableListGetSourceTableInfo
(
pTableScanInfo
->
base
.
pTableListInfo
,
&
suid
,
&
uid
,
&
type
);
// let's discard the tables those are not created according to the queried super table.
SMetaReader
mr
=
{
0
};
...
...
@@ -353,7 +354,7 @@ static SArray* filterUnqualifiedTables(const SStreamScanInfo* pScanInfo, const S
}
else
{
if
(
type
==
TSDB_SUPER_TABLE
)
{
// this new created child table does not belong to the scanned super table.
if
(
mr
.
me
.
type
!=
TSDB_CHILD_TABLE
||
mr
.
me
.
ctbEntry
.
suid
!=
uid
)
{
if
(
mr
.
me
.
type
!=
TSDB_CHILD_TABLE
||
mr
.
me
.
ctbEntry
.
suid
!=
s
uid
)
{
continue
;
}
}
else
{
// ordinary table
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录