Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4e747827
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看板
提交
4e747827
编写于
10月 29, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
6fc0e1b6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
28 deletion
+33
-28
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+0
-2
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+20
-8
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+13
-18
未找到文件。
source/libs/executor/src/executil.c
浏览文件 @
4e747827
...
...
@@ -741,8 +741,6 @@ int32_t getColInfoResultForGroupby(void* metaHandle, SNodeList* group, STableLis
int32_t
len
=
(
int32_t
)(
pStart
-
(
char
*
)
keyBuf
);
info
->
groupId
=
calcGroupId
(
keyBuf
,
len
);
taosHashPut
(
pTableListInfo
->
map
,
&
(
info
->
uid
),
sizeof
(
uint64_t
),
&
i
,
sizeof
(
int32_t
));
}
// int64_t st2 = taosGetTimestampUs();
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
4e747827
...
...
@@ -3379,7 +3379,7 @@ static int32_t sortTableGroup(STableListInfo* pTableListInfo) {
int32_t
code
=
TSDB_CODE_SUCCESS
;
taosArraySort
(
pTableListInfo
->
pTableList
,
orderbyGroupIdComparFn
);
int32_t
size
=
getTotalTables
(
pTableListInfo
);
int32_t
size
=
taosArrayGetSize
(
pTableListInfo
->
pTableList
);
SArray
*
pList
=
taosArrayInit
(
4
,
sizeof
(
int32_t
));
...
...
@@ -3403,7 +3403,6 @@ static int32_t sortTableGroup(STableListInfo* pTableListInfo) {
taosArrayDestroy
(
pList
);
# if 0
SArray
*
sortSupport
=
taosArrayInit
(
16
,
sizeof
(
uint64_t
));
if
(
sortSupport
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -3504,13 +3503,12 @@ int32_t setGroupIdMapForAllTables(STableListInfo* pTableListInfo, SReadHandle* p
for
(
int32_t
i
=
0
;
i
<
numOfTables
;
i
++
)
{
STableKeyInfo
*
info
=
taosArrayGet
(
pTableListInfo
->
pTableList
,
i
);
info
->
groupId
=
groupByTbname
?
info
->
uid
:
0
;
taosHashPut
(
pTableListInfo
->
map
,
&
(
info
->
uid
),
sizeof
(
uint64_t
),
&
i
,
sizeof
(
int32_t
));
}
pTableListInfo
->
oneTableForEachGroup
=
groupByTbname
;
if
(
groupSort
&&
groupByTbname
)
{
taosArraySort
(
pTableListInfo
->
pTableList
,
orderbyGroupIdComparFn
);
pTableListInfo
->
numOfOuputGroups
=
numOfTables
;
}
else
{
pTableListInfo
->
numOfOuputGroups
=
1
;
...
...
@@ -3526,6 +3524,13 @@ int32_t setGroupIdMapForAllTables(STableListInfo* pTableListInfo, SReadHandle* p
}
}
// add all table entry in the hash map
size_t
size
=
taosArrayGetSize
(
pTableListInfo
->
pTableList
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
STableKeyInfo
*
p
=
taosArrayGet
(
pTableListInfo
->
pTableList
,
i
);
taosHashPut
(
pTableListInfo
->
map
,
&
p
->
uid
,
sizeof
(
uint64_t
),
&
i
,
sizeof
(
int32_t
));
}
return
code
;
}
...
...
@@ -3590,7 +3595,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
==
type
)
{
STableMergeScanPhysiNode
*
pTableScanNode
=
(
STableMergeScanPhysiNode
*
)
pPhyNode
;
int32_t
code
=
createScanTableListInfo
(
&
pTableScanNode
->
scan
,
pTableScanNode
->
pGroupTags
,
pTableScanNode
->
groupSort
,
pHandle
,
createScanTableListInfo
(
&
pTableScanNode
->
scan
,
pTableScanNode
->
pGroupTags
,
/*pTableScanNode->groupSort*/
true
,
pHandle
,
pTableListInfo
,
pTagCond
,
pTagIndexCond
,
GET_TASKID
(
pTaskInfo
));
if
(
code
)
{
pTaskInfo
->
code
=
code
;
...
...
@@ -3652,16 +3657,23 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
==
type
)
{
SBlockDistScanPhysiNode
*
pBlockNode
=
(
SBlockDistScanPhysiNode
*
)
pPhyNode
;
pTableListInfo
->
pTableList
=
taosArrayInit
(
4
,
sizeof
(
STableKeyInfo
));
pTableListInfo
->
numOfOuputGroups
=
1
;
if
(
pBlockNode
->
tableType
==
TSDB_SUPER_TABLE
)
{
int32_t
code
=
vnodeGetAllTableList
(
pHandle
->
vnode
,
pBlockNode
->
uid
,
pTableListInfo
->
pTableList
);
SArray
*
pList
=
taosArrayInit
(
4
,
sizeof
(
STableKeyInfo
));
int32_t
code
=
vnodeGetAllTableList
(
pHandle
->
vnode
,
pBlockNode
->
uid
,
pList
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pTaskInfo
->
code
=
terrno
;
return
NULL
;
}
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pTableListInfo
->
pTableList
);
++
i
)
{
STableKeyInfo
*
p
=
taosArrayGet
(
pList
,
i
);
addTableIntoTableList
(
pTableListInfo
,
p
->
uid
,
0
);
}
taosArrayDestroy
(
pList
);
}
else
{
// Create one table group.
STableKeyInfo
info
=
{.
uid
=
pBlockNode
->
uid
,
.
groupId
=
0
};
taosArrayPush
(
pTableListInfo
->
pTableList
,
&
info
);
addTableIntoTableList
(
pTableListInfo
,
pBlockNode
->
uid
,
0
);
}
SQueryTableDataCond
cond
=
{
0
};
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
4e747827
...
...
@@ -1118,6 +1118,8 @@ static SSDataBlock* readPreVersionData(SOperatorInfo* pTableScanOp, uint64_t tbU
relocateColumnData
(
pBlock
,
pTableScanInfo
->
matchInfo
.
pList
,
pCols
,
true
);
doSetTagColumnData
(
pTableScanInfo
,
pBlock
,
pTaskInfo
);
pBlock
->
info
.
groupId
=
getTableGroupId
(
&
pTaskInfo
->
tableqinfoList
,
binfo
.
uid
);
}
tsdbReaderClose
(
pReader
);
...
...
@@ -3050,11 +3052,11 @@ static int32_t sysFilte__TableName(void* arg, SNode* pNode, SArray* result) {
if
(
func
==
NULL
)
return
-
1
;
SMetaFltParam
param
=
{.
suid
=
0
,
.
cid
=
0
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
val
=
pVal
->
datum
.
p
,
.
reverse
=
reverse
,
.
filterFunc
=
func
};
.
cid
=
0
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
val
=
pVal
->
datum
.
p
,
.
reverse
=
reverse
,
.
filterFunc
=
func
};
return
-
1
;
}
...
...
@@ -3069,11 +3071,11 @@ static int32_t sysFilte__CreateTime(void* arg, SNode* pNode, SArray* result) {
if
(
func
==
NULL
)
return
-
1
;
SMetaFltParam
param
=
{.
suid
=
0
,
.
cid
=
0
,
.
type
=
TSDB_DATA_TYPE_BIGINT
,
.
val
=
&
pVal
->
datum
.
i
,
.
reverse
=
reverse
,
.
filterFunc
=
func
};
.
cid
=
0
,
.
type
=
TSDB_DATA_TYPE_BIGINT
,
.
val
=
&
pVal
->
datum
.
i
,
.
reverse
=
reverse
,
.
filterFunc
=
func
};
int32_t
ret
=
metaFilterCreateTime
(
pMeta
,
&
param
,
result
);
return
ret
;
...
...
@@ -4746,9 +4748,6 @@ int32_t startGroupTableMergeScan(SOperatorInfo* pOperator) {
pInfo
->
queryConds
=
taosArrayInit
(
numOfTable
,
sizeof
(
SQueryTableDataCond
));
for
(
int32_t
i
=
0
;
i
<
numOfTable
;
++
i
)
{
STableKeyInfo
*
tableKeyInfo
=
taosArrayGet
(
pInfo
->
tableListInfo
->
pTableList
,
i
+
tableStartIdx
);
size_t
numReaders
=
taosArrayGetSize
(
pInfo
->
dataReaders
);
STableMergeScanSortSourceParam
param
=
{
0
};
param
.
readerIdx
=
i
;
param
.
pOperator
=
pOperator
;
...
...
@@ -4959,10 +4958,6 @@ SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanN
goto
_error
;
}
if
(
pTableScanNode
->
pGroupTags
)
{
taosArraySort
(
pTableListInfo
->
pTableList
,
compareTableKeyInfoByGid
);
}
SDataBlockDescNode
*
pDescNode
=
pTableScanNode
->
scan
.
node
.
pOutputDataBlockDesc
;
int32_t
numOfCols
=
0
;
...
...
@@ -5016,7 +5011,7 @@ SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanN
pOperator
->
cost
.
openCost
=
0
;
return
pOperator
;
_error:
_error:
pTaskInfo
->
code
=
TSDB_CODE_OUT_OF_MEMORY
;
taosMemoryFree
(
pInfo
);
taosMemoryFree
(
pOperator
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录