Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4939f547
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4939f547
编写于
2月 06, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix invalid code
上级
a76dbe0b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
6 deletion
+21
-6
source/libs/executor/src/groupoperator.c
source/libs/executor/src/groupoperator.c
+21
-6
未找到文件。
source/libs/executor/src/groupoperator.c
浏览文件 @
4939f547
...
@@ -492,8 +492,8 @@ _error:
...
@@ -492,8 +492,8 @@ _error:
static
void
doHashPartition
(
SOperatorInfo
*
pOperator
,
SSDataBlock
*
pBlock
)
{
static
void
doHashPartition
(
SOperatorInfo
*
pOperator
,
SSDataBlock
*
pBlock
)
{
SPartitionOperatorInfo
*
pInfo
=
pOperator
->
info
;
SPartitionOperatorInfo
*
pInfo
=
pOperator
->
info
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
for
(
int32_t
j
=
0
;
j
<
pBlock
->
info
.
rows
;
++
j
)
{
for
(
int32_t
j
=
0
;
j
<
pBlock
->
info
.
rows
;
++
j
)
{
recordNewGroupKeys
(
pInfo
->
pGroupCols
,
pInfo
->
pGroupColVals
,
pBlock
,
j
);
recordNewGroupKeys
(
pInfo
->
pGroupCols
,
pInfo
->
pGroupColVals
,
pBlock
,
j
);
int32_t
len
=
buildGroupKeys
(
pInfo
->
keyBuf
,
pInfo
->
pGroupColVals
);
int32_t
len
=
buildGroupKeys
(
pInfo
->
keyBuf
,
pInfo
->
pGroupColVals
);
...
@@ -690,8 +690,8 @@ static int compareDataGroupInfo(const void* group1, const void* group2) {
...
@@ -690,8 +690,8 @@ static int compareDataGroupInfo(const void* group1, const void* group2) {
static
SSDataBlock
*
buildPartitionResult
(
SOperatorInfo
*
pOperator
)
{
static
SSDataBlock
*
buildPartitionResult
(
SOperatorInfo
*
pOperator
)
{
SPartitionOperatorInfo
*
pInfo
=
pOperator
->
info
;
SPartitionOperatorInfo
*
pInfo
=
pOperator
->
info
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
SDataGroupInfo
*
pGroupInfo
=
SDataGroupInfo
*
pGroupInfo
=
(
pInfo
->
groupIndex
!=
-
1
)
?
taosArrayGet
(
pInfo
->
sortedGroupArray
,
pInfo
->
groupIndex
)
:
NULL
;
(
pInfo
->
groupIndex
!=
-
1
)
?
taosArrayGet
(
pInfo
->
sortedGroupArray
,
pInfo
->
groupIndex
)
:
NULL
;
if
(
pInfo
->
groupIndex
==
-
1
||
pInfo
->
pageIndex
>=
taosArrayGetSize
(
pGroupInfo
->
pPageList
))
{
if
(
pInfo
->
groupIndex
==
-
1
||
pInfo
->
pageIndex
>=
taosArrayGetSize
(
pGroupInfo
->
pPageList
))
{
...
@@ -713,7 +713,7 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) {
...
@@ -713,7 +713,7 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) {
qError
(
"failed to get buffer, code:%s, %s"
,
tstrerror
(
terrno
),
GET_TASKID
(
pTaskInfo
));
qError
(
"failed to get buffer, code:%s, %s"
,
tstrerror
(
terrno
),
GET_TASKID
(
pTaskInfo
));
T_LONG_JMP
(
pTaskInfo
->
env
,
terrno
);
T_LONG_JMP
(
pTaskInfo
->
env
,
terrno
);
}
}
blockDataEnsureCapacity
(
pInfo
->
binfo
.
pRes
,
pInfo
->
rowCapacity
);
blockDataEnsureCapacity
(
pInfo
->
binfo
.
pRes
,
pInfo
->
rowCapacity
);
blockDataFromBuf1
(
pInfo
->
binfo
.
pRes
,
page
,
pInfo
->
rowCapacity
);
blockDataFromBuf1
(
pInfo
->
binfo
.
pRes
,
page
,
pInfo
->
rowCapacity
);
...
@@ -829,6 +829,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
...
@@ -829,6 +829,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
SPartitionOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SPartitionOperatorInfo
));
SPartitionOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SPartitionOperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
if
(
pInfo
==
NULL
||
pOperator
==
NULL
)
{
if
(
pInfo
==
NULL
||
pOperator
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
pTaskInfo
->
code
=
terrno
;
goto
_error
;
goto
_error
;
}
}
...
@@ -841,6 +843,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
...
@@ -841,6 +843,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
SExprInfo
*
pExprInfo1
=
createExprInfo
(
pPartNode
->
pExprs
,
NULL
,
&
num
);
SExprInfo
*
pExprInfo1
=
createExprInfo
(
pPartNode
->
pExprs
,
NULL
,
&
num
);
int32_t
code
=
initExprSupp
(
&
pInfo
->
scalarSup
,
pExprInfo1
,
num
);
int32_t
code
=
initExprSupp
(
&
pInfo
->
scalarSup
,
pExprInfo1
,
num
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
pTaskInfo
->
code
=
terrno
;
goto
_error
;
goto
_error
;
}
}
}
}
...
@@ -848,6 +852,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
...
@@ -848,6 +852,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
_hash_fn_t
hashFn
=
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
);
_hash_fn_t
hashFn
=
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
);
pInfo
->
pGroupSet
=
taosHashInit
(
100
,
hashFn
,
false
,
HASH_NO_LOCK
);
pInfo
->
pGroupSet
=
taosHashInit
(
100
,
hashFn
,
false
,
HASH_NO_LOCK
);
if
(
pInfo
->
pGroupSet
==
NULL
)
{
if
(
pInfo
->
pGroupSet
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
pTaskInfo
->
code
=
terrno
;
goto
_error
;
goto
_error
;
}
}
...
@@ -866,6 +872,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
...
@@ -866,6 +872,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
int32_t
code
=
createDiskbasedBuf
(
&
pInfo
->
pBuf
,
defaultPgsz
,
defaultBufsz
,
pTaskInfo
->
id
.
str
,
tsTempDir
);
int32_t
code
=
createDiskbasedBuf
(
&
pInfo
->
pBuf
,
defaultPgsz
,
defaultBufsz
,
pTaskInfo
->
id
.
str
,
tsTempDir
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
pTaskInfo
->
code
=
code
;
goto
_error
;
goto
_error
;
}
}
...
@@ -873,6 +881,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
...
@@ -873,6 +881,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
pInfo
->
columnOffset
=
setupColumnOffset
(
pInfo
->
binfo
.
pRes
,
pInfo
->
rowCapacity
);
pInfo
->
columnOffset
=
setupColumnOffset
(
pInfo
->
binfo
.
pRes
,
pInfo
->
rowCapacity
);
code
=
initGroupOptrInfo
(
&
pInfo
->
pGroupColVals
,
&
pInfo
->
groupKeyLen
,
&
pInfo
->
keyBuf
,
pInfo
->
pGroupCols
);
code
=
initGroupOptrInfo
(
&
pInfo
->
pGroupColVals
,
&
pInfo
->
groupKeyLen
,
&
pInfo
->
keyBuf
,
pInfo
->
pGroupCols
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
pTaskInfo
->
code
=
code
;
goto
_error
;
goto
_error
;
}
}
...
@@ -885,10 +895,15 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
...
@@ -885,10 +895,15 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
createOperatorFpSet
(
optrDummyOpenFn
,
hashPartition
,
NULL
,
destroyPartitionOperatorInfo
,
optrDefaultBufFn
,
NULL
);
createOperatorFpSet
(
optrDummyOpenFn
,
hashPartition
,
NULL
,
destroyPartitionOperatorInfo
,
optrDefaultBufFn
,
NULL
);
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
pTaskInfo
->
code
=
code
;
goto
_error
;
}
return
pOperator
;
return
pOperator
;
_error:
_error:
pTaskInfo
->
code
=
TSDB_CODE_OUT_OF_MEMORY
;
if
(
pInfo
!=
NULL
)
{
if
(
pInfo
!=
NULL
)
{
destroyPartitionOperatorInfo
(
pInfo
);
destroyPartitionOperatorInfo
(
pInfo
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录