Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1898656a
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1898656a
编写于
10月 20, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add executor to systable filter
上级
19958284
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
23 deletion
+28
-23
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+28
-23
未找到文件。
source/libs/executor/src/scanoperator.c
浏览文件 @
1898656a
...
@@ -53,7 +53,7 @@ typedef struct {
...
@@ -53,7 +53,7 @@ typedef struct {
typedef
struct
{
typedef
struct
{
void
*
pMeta
;
void
*
pMeta
;
void
*
reserv
e
;
void
*
pVnod
e
;
}
SSTabFltArg
;
}
SSTabFltArg
;
static
int32_t
sysChkFilter__DBName
(
SNode
*
pNode
);
static
int32_t
sysChkFilter__DBName
(
SNode
*
pNode
);
...
@@ -2909,8 +2909,8 @@ static __optSysFilter optSysGetFilterFunc(int32_t ctype, bool* reverse) {
...
@@ -2909,8 +2909,8 @@ static __optSysFilter optSysGetFilterFunc(int32_t ctype, bool* reverse) {
return
optSysFilterFuncImpl__Equal
;
return
optSysFilterFuncImpl__Equal
;
return
NULL
;
return
NULL
;
}
}
static
int32_t
sysFilte__DbName
(
void
*
pMeta
,
SNode
*
pNode
,
SArray
*
result
)
{
static
int32_t
sysFilte__DbName
(
void
*
arg
,
SNode
*
pNode
,
SArray
*
result
)
{
void
*
pVnode
=
pMeta
;
void
*
pVnode
=
((
SSTabFltArg
*
)
arg
)
->
pVnode
;
const
char
*
db
=
NULL
;
const
char
*
db
=
NULL
;
vnodeGetInfo
(
pVnode
,
&
db
,
NULL
);
vnodeGetInfo
(
pVnode
,
&
db
,
NULL
);
...
@@ -2935,8 +2935,8 @@ static int32_t sysFilte__DbName(void* pMeta, SNode* pNode, SArray* result) {
...
@@ -2935,8 +2935,8 @@ static int32_t sysFilte__DbName(void* pMeta, SNode* pNode, SArray* result) {
return
-
1
;
return
-
1
;
}
}
static
int32_t
sysFilte__VgroupId
(
void
*
pMeta
,
SNode
*
pNode
,
SArray
*
result
)
{
static
int32_t
sysFilte__VgroupId
(
void
*
arg
,
SNode
*
pNode
,
SArray
*
result
)
{
void
*
pVnode
=
pMeta
;
void
*
pVnode
=
((
SSTabFltArg
*
)
arg
)
->
pVnode
;
int32_t
vgId
=
0
;
int32_t
vgId
=
0
;
vnodeGetInfo
(
pVnode
,
NULL
,
&
vgId
);
vnodeGetInfo
(
pVnode
,
NULL
,
&
vgId
);
...
@@ -2954,8 +2954,8 @@ static int32_t sysFilte__VgroupId(void* pMeta, SNode* pNode, SArray* result) {
...
@@ -2954,8 +2954,8 @@ static int32_t sysFilte__VgroupId(void* pMeta, SNode* pNode, SArray* result) {
return
-
1
;
return
-
1
;
}
}
static
int32_t
sysFilte__TableName
(
void
*
pMeta
,
SNode
*
pNode
,
SArray
*
result
)
{
static
int32_t
sysFilte__TableName
(
void
*
arg
,
SNode
*
pNode
,
SArray
*
result
)
{
void
*
p
Vnode
=
pMeta
;
void
*
p
Meta
=
((
SSTabFltArg
*
)
arg
)
->
pMeta
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
...
@@ -2970,14 +2970,14 @@ static int32_t sysFilte__TableName(void* pMeta, SNode* pNode, SArray* result) {
...
@@ -2970,14 +2970,14 @@ static int32_t sysFilte__TableName(void* pMeta, SNode* pNode, SArray* result) {
.
val
=
pVal
->
datum
.
p
,
.
val
=
pVal
->
datum
.
p
,
.
reverse
=
reverse
,
.
reverse
=
reverse
,
.
filterFunc
=
func
};
.
filterFunc
=
func
};
int32_t
ret
=
metaFilterTableName
(
p
Vnode
,
&
param
,
result
);
int32_t
ret
=
metaFilterTableName
(
p
Meta
,
&
param
,
result
);
if
(
ret
==
0
)
return
0
;
if
(
ret
==
0
)
return
0
;
return
-
1
;
return
-
1
;
}
}
static
int32_t
sysFilte__CreateTime
(
void
*
pMeta
,
SNode
*
pNode
,
SArray
*
result
)
{
static
int32_t
sysFilte__CreateTime
(
void
*
arg
,
SNode
*
pNode
,
SArray
*
result
)
{
void
*
p
Vnode
=
pMeta
;
void
*
p
Meta
=
((
SSTabFltArg
*
)
arg
)
->
pMeta
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
...
@@ -2987,8 +2987,8 @@ static int32_t sysFilte__CreateTime(void* pMeta, SNode* pNode, SArray* result) {
...
@@ -2987,8 +2987,8 @@ static int32_t sysFilte__CreateTime(void* pMeta, SNode* pNode, SArray* result) {
if
(
func
==
NULL
)
return
-
1
;
if
(
func
==
NULL
)
return
-
1
;
return
0
;
return
0
;
}
}
static
int32_t
sysFilte__Ncolumn
(
void
*
pMeta
,
SNode
*
pNode
,
SArray
*
result
)
{
static
int32_t
sysFilte__Ncolumn
(
void
*
arg
,
SNode
*
pNode
,
SArray
*
result
)
{
void
*
p
Vnode
=
pMeta
;
void
*
p
Meta
=
((
SSTabFltArg
*
)
arg
)
->
pMeta
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
...
@@ -2999,8 +2999,8 @@ static int32_t sysFilte__Ncolumn(void* pMeta, SNode* pNode, SArray* result) {
...
@@ -2999,8 +2999,8 @@ static int32_t sysFilte__Ncolumn(void* pMeta, SNode* pNode, SArray* result) {
return
0
;
return
0
;
}
}
static
int32_t
sysFilte__Ttl
(
void
*
pMeta
,
SNode
*
pNode
,
SArray
*
result
)
{
static
int32_t
sysFilte__Ttl
(
void
*
arg
,
SNode
*
pNode
,
SArray
*
result
)
{
void
*
p
Vnode
=
pMeta
;
void
*
p
Meta
=
((
SSTabFltArg
*
)
arg
)
->
pMeta
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
...
@@ -3010,8 +3010,8 @@ static int32_t sysFilte__Ttl(void* pMeta, SNode* pNode, SArray* result) {
...
@@ -3010,8 +3010,8 @@ static int32_t sysFilte__Ttl(void* pMeta, SNode* pNode, SArray* result) {
if
(
func
==
NULL
)
return
-
1
;
if
(
func
==
NULL
)
return
-
1
;
return
0
;
return
0
;
}
}
static
int32_t
sysFilte__STableName
(
void
*
pMeta
,
SNode
*
pNode
,
SArray
*
result
)
{
static
int32_t
sysFilte__STableName
(
void
*
arg
,
SNode
*
pNode
,
SArray
*
result
)
{
void
*
p
Vnode
=
pMeta
;
void
*
p
Meta
=
((
SSTabFltArg
*
)
arg
)
->
pMeta
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
...
@@ -3021,8 +3021,8 @@ static int32_t sysFilte__STableName(void* pMeta, SNode* pNode, SArray* result) {
...
@@ -3021,8 +3021,8 @@ static int32_t sysFilte__STableName(void* pMeta, SNode* pNode, SArray* result) {
if
(
func
==
NULL
)
return
-
1
;
if
(
func
==
NULL
)
return
-
1
;
return
0
;
return
0
;
}
}
static
int32_t
sysFilte__Uid
(
void
*
pMeta
,
SNode
*
pNode
,
SArray
*
result
)
{
static
int32_t
sysFilte__Uid
(
void
*
arg
,
SNode
*
pNode
,
SArray
*
result
)
{
void
*
p
Vnode
=
pMeta
;
void
*
p
Meta
=
((
SSTabFltArg
*
)
arg
)
->
pMeta
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
...
@@ -3032,8 +3032,8 @@ static int32_t sysFilte__Uid(void* pMeta, SNode* pNode, SArray* result) {
...
@@ -3032,8 +3032,8 @@ static int32_t sysFilte__Uid(void* pMeta, SNode* pNode, SArray* result) {
if
(
func
==
NULL
)
return
-
1
;
if
(
func
==
NULL
)
return
-
1
;
return
0
;
return
0
;
}
}
static
int32_t
sysFilte__Type
(
void
*
pMeta
,
SNode
*
pNode
,
SArray
*
result
)
{
static
int32_t
sysFilte__Type
(
void
*
arg
,
SNode
*
pNode
,
SArray
*
result
)
{
void
*
p
Vnode
=
pMeta
;
void
*
p
Meta
=
((
SSTabFltArg
*
)
arg
)
->
pMeta
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SOperatorNode
*
pOper
=
(
SOperatorNode
*
)
pNode
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
SValueNode
*
pVal
=
(
SValueNode
*
)
pOper
->
pRight
;
...
@@ -3247,7 +3247,7 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator, SArr
...
@@ -3247,7 +3247,7 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator, SArr
tb_uid_t
*
uid
=
taosArrayGet
(
pUids
,
i
);
tb_uid_t
*
uid
=
taosArrayGet
(
pUids
,
i
);
SMetaReader
mr
=
{
0
};
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
NULL
,
0
);
metaReaderInit
(
&
mr
,
pInfo
->
readHandle
.
meta
,
0
);
int32_t
ret
=
metaGetTableEntryByUid
(
&
mr
,
*
uid
);
int32_t
ret
=
metaGetTableEntryByUid
(
&
mr
,
*
uid
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
metaReaderClear
(
&
mr
);
metaReaderClear
(
&
mr
);
...
@@ -3357,6 +3357,9 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator, SArr
...
@@ -3357,6 +3357,9 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator, SArr
STR_TO_VARSTR
(
n
,
"NORMAL_TABLE"
);
STR_TO_VARSTR
(
n
,
"NORMAL_TABLE"
);
// impl later
// impl later
}
}
metaReaderClear
(
&
mr
);
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
9
);
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
9
);
colDataAppend
(
pColInfoData
,
numOfRows
,
n
,
false
);
colDataAppend
(
pColInfoData
,
numOfRows
,
n
,
false
);
...
@@ -3594,8 +3597,10 @@ static SSDataBlock* sysTableScanUserTables(SOperatorInfo* pOperator) {
...
@@ -3594,8 +3597,10 @@ static SSDataBlock* sysTableScanUserTables(SOperatorInfo* pOperator) {
return
(
pInfo
->
pRes
->
info
.
rows
==
0
)
?
NULL
:
pInfo
->
pRes
;
return
(
pInfo
->
pRes
->
info
.
rows
==
0
)
?
NULL
:
pInfo
->
pRes
;
}
else
{
}
else
{
if
(
pCondition
!=
NULL
)
{
if
(
pCondition
!=
NULL
)
{
SArray
*
uids
=
taosArrayInit
(
128
,
sizeof
(
int64_t
));
SSTabFltArg
arg
=
{.
pMeta
=
pInfo
->
readHandle
.
meta
,
.
pVnode
=
pInfo
->
readHandle
.
vnode
};
int
flt
=
optSysTabFilte
(
NULL
,
pCondition
,
uids
);
SArray
*
uids
=
taosArrayInit
(
128
,
sizeof
(
int64_t
));
int
flt
=
optSysTabFilte
(
&
arg
,
pCondition
,
uids
);
if
(
flt
==
0
)
{
if
(
flt
==
0
)
{
SSDataBlock
*
blk
=
sysTableBuildUserTablesByUids
(
pOperator
,
uids
);
SSDataBlock
*
blk
=
sysTableBuildUserTablesByUids
(
pOperator
,
uids
);
taosArrayDestroy
(
uids
);
taosArrayDestroy
(
uids
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录