Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e6a89a8d
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看板
提交
e6a89a8d
编写于
2月 28, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0_query_integrate' of github.com:taosdata/TDengine into 3.0_query_integrate
上级
195ff4f5
beae099a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
622 addition
and
114 deletion
+622
-114
source/libs/executor/test/executorTests.cpp
source/libs/executor/test/executorTests.cpp
+622
-114
未找到文件。
source/libs/executor/test/executorTests.cpp
浏览文件 @
e6a89a8d
...
...
@@ -125,127 +125,633 @@ int main(int argc, char** argv) {
TEST
(
testCase
,
build_executor_tree_Test
)
{
const
char
*
msg
=
"{
\n
"
"
\t\"
Id
\"
:
\t
{
\n
"
"
\t\t\"
QueryId
\"
:
\t
1.3108161807422521e+19,
\n
"
"
\t\t\"
TemplateId
\"
:
\t
0,
\n
"
"
\t\t\"
SubplanId
\"
:
\t
0
\n
"
"
\t
},
\n
"
"
\t\"
Node
\"
:
\t
{
\n
"
"
\t\t\"
Name
\"
:
\t\"
TableScan
\"
,
\n
"
"
\t\t\"
Targets
\"
:
\t
[{
\n
"
"
\t\t\t\t\"
Base
\"
:
\t
{
\n
"
"
\t\t\t\t\t\"
Schema
\"
:
\t
{
\n
"
"
\t\t\t\t\t\t\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
\t\t\t\t\"
EndKey
\"
:
\t
9.2233720368547758e+18
\n
"
"
\t\t\t
}
\n
"
"
\t\t
}
\n
"
"
\t
},
\n
"
"
\t\"
DataSink
\"
:
\t
{
\n
"
"
\t\t\"
Name
\"
:
\t\"
Dispatch
\"
,
\n
"
"
\t\t\"
Dispatch
\"
:
\t
{
\n
"
"
\t\t
}
\n
"
"
\t
}
\n
"
"}"
;
"
\"
Type
\"
:
\"
33
\"
,
\n
"
"
\"
Name
\"
:
\"
PhysiProject
\"
,
\n
"
"
\"
PhysiProject
\"
: {
\n
"
"
\"
OutputDataBlockDesc
\"
: {
\n
"
"
\"
Type
\"
:
\"
19
\"
,
\n
"
"
\"
Name
\"
:
\"
TupleDesc
\"
,
\n
"
"
\"
TupleDesc
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
1
\"
,
\n
"
"
\"
Slots
\"
: [
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
0
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
9
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: false
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
1
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
4
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
4
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: false
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
2
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
8
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
20
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: false
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
3
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
5
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: false
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
4
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
7
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: false
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
5
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
7
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: false
\n
"
" }
\n
"
" }
\n
"
" ]
\n
"
" }
\n
"
" },
\n
"
"
\"
Children
\"
: [
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
30
\"
,
\n
"
"
\"
Name
\"
:
\"
PhysiTableScan
\"
,
\n
"
"
\"
PhysiTableScan
\"
: {
\n
"
"
\"
OutputDataBlockDesc
\"
: {
\n
"
"
\"
Type
\"
:
\"
19
\"
,
\n
"
"
\"
Name
\"
:
\"
TupleDesc
\"
,
\n
"
"
\"
TupleDesc
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
Slots
\"
: [
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
0
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
9
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: true
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
1
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
4
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
4
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: true
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
2
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
8
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
20
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: true
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
3
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
5
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: true
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
4
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
7
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: true
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
20
\"
,
\n
"
"
\"
Name
\"
:
\"
SlotDesc
\"
,
\n
"
"
\"
SlotDesc
\"
: {
\n
"
"
\"
SlotId
\"
:
\"
5
\"
,
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
7
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
Reserve
\"
: false,
\n
"
"
\"
Output
\"
: true
\n
"
" }
\n
"
" }
\n
"
" ]
\n
"
" }
\n
"
" },
\n
"
"
\"
ScanCols
\"
: [
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
0
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
9
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
ts
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
1
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
ts
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
0
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
1
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
4
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
4
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c1
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
2
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c1
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
0
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
2
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
8
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
20
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c2
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
3
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c2
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
0
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
3
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
5
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c3
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
4
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c3
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
0
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
4
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
7
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c4
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
5
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c4
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
0
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
5
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
7
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c5
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
6
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c5
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
0
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" ],
\n
"
"
\"
TableId
\"
:
\"
1
\"
,
\n
"
"
\"
TableType
\"
:
\"
3
\"
,
\n
"
"
\"
ScanOrder
\"
:
\"
1
\"
,
\n
"
"
\"
ScanCount
\"
:
\"
1
\"
,
\n
"
"
\"
ReverseScanCount
\"
:
\"
0
\"
,
\n
"
"
\"
ScanFlag
\"
:
\"
0
\"
,
\n
"
"
\"
StartKey
\"
:
\"
-9223372036854775808
\"
,
\n
"
"
\"
EndKey
\"
:
\"
9223372036854775807
\"\n
"
" }
\n
"
" }
\n
"
" ],
\n
"
"
\"
Projections
\"
: [
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
1
\"
,
\n
"
"
\"
SlotId
\"
:
\"
0
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
9
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
ts
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
1
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
ts
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
0
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
1
\"
,
\n
"
"
\"
SlotId
\"
:
\"
1
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
4
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
4
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c1
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
2
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c1
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
1
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
1
\"
,
\n
"
"
\"
SlotId
\"
:
\"
2
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
8
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
20
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c2
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
3
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c2
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
2
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
1
\"
,
\n
"
"
\"
SlotId
\"
:
\"
3
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
5
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c3
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
4
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c3
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
3
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
1
\"
,
\n
"
"
\"
SlotId
\"
:
\"
4
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
7
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c4
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
5
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c4
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
4
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" },
\n
"
" {
\n
"
"
\"
Type
\"
:
\"
18
\"
,
\n
"
"
\"
Name
\"
:
\"
Target
\"
,
\n
"
"
\"
Target
\"
: {
\n
"
"
\"
DataBlockId
\"
:
\"
1
\"
,
\n
"
"
\"
SlotId
\"
:
\"
5
\"
,
\n
"
"
\"
Expr
\"
: {
\n
"
"
\"
Type
\"
:
\"
1
\"
,
\n
"
"
\"
Name
\"
:
\"
Column
\"
,
\n
"
"
\"
Column
\"
: {
\n
"
"
\"
DataType
\"
: {
\n
"
"
\"
Type
\"
:
\"
7
\"
,
\n
"
"
\"
Precision
\"
:
\"
0
\"
,
\n
"
"
\"
Scale
\"
:
\"
0
\"
,
\n
"
"
\"
Bytes
\"
:
\"
8
\"\n
"
" },
\n
"
"
\"
AliasName
\"
:
\"
c5
\"
,
\n
"
"
\"
TableId
\"
:
\"
0
\"
,
\n
"
"
\"
ColId
\"
:
\"
6
\"
,
\n
"
"
\"
ColType
\"
:
\"
1
\"
,
\n
"
"
\"
DbName
\"
:
\"
test
\"
,
\n
"
"
\"
TableName
\"
:
\"
t1
\"
,
\n
"
"
\"
TableAlias
\"
:
\"
t1
\"
,
\n
"
"
\"
ColName
\"
:
\"
c5
\"
,
\n
"
"
\"
DataBlockId
\"
:
\"
0
\"
,
\n
"
"
\"
SlotId
\"
:
\"
5
\"\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" }
\n
"
" ]
\n
"
" }
\n
"
"}"
;
SExecTaskInfo
*
pTaskInfo
=
nullptr
;
DataSinkHandle
sinkHandle
=
nullptr
;
SReadHandle
handle
=
{.
reader
=
reinterpret_cast
<
void
*>
(
0x1
),
.
meta
=
reinterpret_cast
<
void
*>
(
0x1
)};
// int32_t code = qCreateExecTask(&handle, 2, 1, NULL, (void**) &pTaskInfo, &sinkHandle);
struct
SSubplan
*
plan
=
NULL
;
int32_t
code
=
qStringToSubplan
(
msg
,
&
plan
);
ASSERT_EQ
(
code
,
0
);
code
=
qCreateExecTask
(
&
handle
,
2
,
1
,
plan
,
(
void
**
)
&
pTaskInfo
,
&
sinkHandle
);
ASSERT_EQ
(
code
,
0
);
}
//TEST(testCase, inMem_sort_Test) {
// SArray* pOrderVal = taosArrayInit(4, sizeof(SOrder));
// SOrder o = {.order = TSDB_ORDER_ASC};
// o.col.info.colId = 1;
// o.col.info.type = TSDB_DATA_TYPE_INT;
// taosArrayPush(pOrderVal, &o);
//
// SArray* pExprInfo = taosArrayInit(4, sizeof(SExprInfo));
// SExprInfo *exp = static_cast<SExprInfo*>(calloc(1, sizeof(SExprInfo)));
// exp->base.resSchema = createSchema(TSDB_DATA_TYPE_INT, sizeof(int32_t), 1, "res");
// taosArrayPush(pExprInfo, &exp);
//
// SExprInfo *exp1 = static_cast<SExprInfo*>(calloc(1, sizeof(SExprInfo)));
// exp1->base.resSchema = createSchema(TSDB_DATA_TYPE_BINARY, 40, 2, "res1");
// taosArrayPush(pExprInfo, &exp1);
//
// SOperatorInfo* pOperator = createOrderOperatorInfo(createDummyOperator(5), pExprInfo, pOrderVal);
//
// bool newgroup = false;
// SSDataBlock* pRes = pOperator->exec(pOperator, &newgroup);
//
// SColumnInfoData* pCol1 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 0));
// SColumnInfoData* pCol2 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 1));
// for(int32_t i = 0; i < pRes->info.rows; ++i) {
// char* p = colDataGet(pCol2, i);
// printf("%d: %d, %s\n", i, ((int32_t*)pCol1->pData)[i], (char*)varDataVal(p));
// }
//}
#if 0
TEST(testCase, inMem_sort_Test) {
SArray* pOrderVal = taosArrayInit(4, sizeof(SOrder));
SOrder o = {.order = TSDB_ORDER_ASC};
o.col.info.colId = 1;
o.col.info.type = TSDB_DATA_TYPE_INT;
taosArrayPush(pOrderVal, &o);
SArray* pExprInfo = taosArrayInit(4, sizeof(SExprInfo));
SExprInfo *exp = static_cast<SExprInfo*>(calloc(1, sizeof(SExprInfo)));
exp->base.resSchema = createSchema(TSDB_DATA_TYPE_INT, sizeof(int32_t), 1, "res");
taosArrayPush(pExprInfo, &exp);
SExprInfo *exp1 = static_cast<SExprInfo*>(calloc(1, sizeof(SExprInfo)));
exp1->base.resSchema = createSchema(TSDB_DATA_TYPE_BINARY, 40, 2, "res1");
taosArrayPush(pExprInfo, &exp1);
SOperatorInfo* pOperator = createOrderOperatorInfo(createDummyOperator(5), pExprInfo, pOrderVal);
bool newgroup = false;
SSDataBlock* pRes = pOperator->exec(pOperator, &newgroup);
SColumnInfoData* pCol1 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 0));
SColumnInfoData* pCol2 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 1));
for(int32_t i = 0; i < pRes->info.rows; ++i) {
char* p = colDataGet(pCol2, i);
printf("%d: %d, %s\n", i, ((int32_t*)pCol1->pData)[i], (char*)varDataVal(p));
}
}
#endif
typedef
struct
su
{
int32_t
v
;
...
...
@@ -282,6 +788,7 @@ TEST(testCase, external_sort_Test) {
return;
#endif
#if 0
srand(time(NULL));
SArray* pOrderVal = taosArrayInit(4, sizeof(SOrder));
...
...
@@ -342,5 +849,6 @@ TEST(testCase, external_sort_Test) {
tfree(exp1);
taosArrayDestroy(pExprInfo);
taosArrayDestroy(pOrderVal);
#endif
}
#pragma GCC diagnostic pop
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录